Skip to content

Commit effe909

Browse files
STY: Enforce ruff rules
Disable some rules and postpone fixes.
1 parent c9ee512 commit effe909

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

.pre-commit-config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ repos:
1212
rev: 24.2.0
1313
hooks:
1414
- id: black
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.6.9
17+
hooks:
18+
- id: ruff
19+
args: ["--fix", "--show-source"]
1520
- repo: https://github.com/codespell-project/codespell
1621
rev: v2.2.6
1722
hooks:

pyproject.toml

+83
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,86 @@ doctest_optionflags = "ALLOW_UNICODE NORMALIZE_WHITESPACE ELLIPSIS"
2525
env = "PYTHONHASHSEED=0"
2626
filterwarnings = ["ignore::DeprecationWarning"]
2727
junit_family = "xunit2"
28+
29+
[tool.ruff]
30+
line-length = 88 # same as black
31+
32+
[tool.ruff.lint]
33+
extend-select = [
34+
"B",
35+
"C4",
36+
"FLY",
37+
"FURB",
38+
"PERF",
39+
"PGH",
40+
"PIE",
41+
"PLE",
42+
"PT",
43+
"PYI",
44+
"Q",
45+
"RSE",
46+
"RUF",
47+
"UP",
48+
]
49+
ignore = [
50+
"B006", # requires annotations
51+
"B011",
52+
"B017", # TODO: enable rule
53+
"B020", # TODO: enable rule
54+
"B028",
55+
"B904",
56+
"C401",
57+
"C408",
58+
"C420", # TODO: enable rule
59+
"E402",
60+
"E722",
61+
"E731", # TODO: enable rule
62+
"F401",
63+
"F403",
64+
"F811",
65+
"F841",
66+
"FURB101",
67+
"FURB103",
68+
"FURB113",
69+
"FURB118", # TODO: enable rule
70+
"FURB140", # TODO: enable rule
71+
"FURB171", # TODO: enable rule
72+
"PGH003", # TODO: enable rule
73+
"PGH004", # TODO: enable rule
74+
"PERF203",
75+
"PIE790",
76+
"PIE794",
77+
"PT001",
78+
"PT004", # deprecated
79+
"PT005", # deprecated
80+
"PT011",
81+
"PT015", # TODO: enable rule
82+
"PT017", # TODO: enable rule
83+
"PT018",
84+
"PT019", # TODO: enable rule
85+
"PT021", # TODO: enable rule
86+
"PYI024",
87+
"RUF002",
88+
"RUF005",
89+
"RUF012", # requires annotations
90+
"RUF015",
91+
"UP027", # deprecated
92+
"UP031", # TODO: enable rule
93+
"UP032", # TODO: enable rule
94+
"UP038", # https://github.com/astral-sh/ruff/issues/7871
95+
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
96+
"W191",
97+
"E111",
98+
"E114",
99+
"E117",
100+
"D206",
101+
"D300",
102+
"Q000",
103+
"Q001",
104+
"Q002",
105+
"Q003",
106+
"COM812",
107+
"COM819",
108+
"ISC001",
109+
"ISC002",
110+
]

0 commit comments

Comments
 (0)