Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
108 lines (92 loc) · 4.83 KB
/
Copy pathpyproject.toml
File metadata and controls
108 lines (92 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Ruff linter configuration — replaces flake8 (see issue #466)
# NOTE: Build config remains in setup.py / setup.cfg (versioneer constraint).
[tool.ruff]
target-version = "py38" # match setup.py python_requires
line-length = 127 # match previous flake8 --max-line-length
exclude = [
"graphistry/graph_vector_pb2.py",
"graphistry/_version.py",
"versioneer.py",
]
[tool.ruff.lint]
# --- Rule selection --------------------------------------------------------
# Enable the same rule families flake8 checked:
# E/W = pycodestyle F = pyflakes C90 = mccabe
select = [
"E", "W", "F", "C90",
# --- flake8-bugbear, dynamic-attribute subset (issue #1825 family) ---
# `getattr(x, "const")` / `setattr(x, "const", v)` hide attribute writes from
# every static tool. Banning the constant-name form is free (both are
# auto-fixable to plain attribute access) and shrinks the surface that
# `bin/ci/ci_type_hygiene_guard.py` has to reason about. Today's offenders are
# seeded into `per-file-ignores` below; run `ruff check --fix --select B009,B010`
# on a file and delete its line to retire the debt.
"B009", # get-attr-with-constant
"B010", # set-attr-with-constant
]
# --- Ignored rules ---------------------------------------------------------
# Carried over from the old flake8 --ignore list.
#
# Codes NOT ported (no ruff equivalents):
# E121, E122, E123, E124, E125, E128, E131 — indentation/continuation
# rules that ruff does not implement (ruff delegates formatting to
# ruff-format or black).
# E144 — non-standard flake8 code, no ruff equivalent.
# W503 — line break before binary operator; PEP 8 reversed its stance
# and ruff does not enforce this.
ignore = [
# --- mccabe ---------------------------
"C901", # function too complex
# --- whitespace (preview) -------------
"E201", # whitespace after '('
"E202", # whitespace before ')'
"E203", # whitespace before ':' / ',' / ';'
"E231", # missing whitespace after ',' / ';' / ':'
"E251", # unexpected spaces around keyword / parameter default
# --- comments (preview) ---------------
"E265", # block comment should start with '# '
# --- blank lines (preview) ------------
"E301", # expected 1 blank line before a nested definition
"E302", # expected 2 blank lines before a function / class definition
"E303", # too many blank lines
# --- imports --------------------------
"E401", # multiple imports on one line
"E402", # module import not at top of file (conditional imports)
"F401", # module imported but unused
# --- line length ----------------------
"E501", # line too long (handled by line-length setting as backstop)
# --- comparison style -----------------
# Ruff finds these but flake8 did not flag them; ignore for parity.
# Consider enabling in a follow-up (95 auto-fixable occurrences).
"E713", # test for membership should be 'not in x'
"E714", # test for object identity should be 'is not'
# --- naming ---------------------------
"E741", # ambiguous variable name (e.g. 'l')
# --- bare except ----------------------
"E722", # do not use bare 'except'
# --- trailing whitespace --------------
"W291", # trailing whitespace
"W293", # whitespace before a comment
]
[tool.ruff.lint.mccabe]
max-complexity = 10 # match previous flake8 --max-complexity
# --- Ratchet: today's B009/B010 offenders --------------------------------
# Seeded from the tree as of the commit that introduced this block. These are
# grandfathered so the rules can be errors for all new code. Each entry is
# retired by `ruff check --fix --select B009,B010 <file>` (the fixes are
# mechanical and behaviour-preserving) and deleting the line.
[tool.ruff.lint.per-file-ignores]
"graphistry/compute/chain.py" = ["B009", "B010"]
"graphistry/compute/gfql/cypher/result_postprocess.py" = ["B009", "B010"]
"graphistry/compute/gfql/lazy/engine/polars/projection.py" = ["B009", "B010"]
"graphistry/compute/gfql/row/pipeline.py" = ["B009", "B010"]
"graphistry/compute/gfql_unified.py" = ["B009", "B010"]
"graphistry/compute/gfql_validate.py" = ["B009", "B010"]
"graphistry/compute/validate/validate_schema.py" = ["B009", "B010"]
"graphistry/tests/compute/gfql/cypher/test_lowering.py" = ["B009", "B010"]
"graphistry/tests/compute/gfql/index/test_index.py" = ["B009", "B010"]
"graphistry/tests/compute/gfql/index/test_indexed_bindings.py" = ["B009", "B010"]
"graphistry/tests/compute/gfql/test_engine_polars_binding_rows.py" = ["B009", "B010"]
"graphistry/tests/compute/gfql/test_engine_polars_with_match_reentry.py" = ["B009", "B010"]
"graphistry/tests/compute/gfql/test_ir_compilation.py" = ["B009", "B010"]
"graphistry/tests/compute/gfql/test_ir_m0b_conformance.py" = ["B009", "B010"]