Skip to content

Commit 9b632fd

Browse files
Reorganise ruff rules (pydata#9738)
Use the same rule ordering as the ruff documentation: https://docs.astral.sh/ruff/rules/
1 parent 876b73a commit 9b632fd

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

pyproject.toml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -234,41 +234,40 @@ extend-exclude = [
234234
]
235235

236236
[tool.ruff.lint]
237-
# E402: module level import not at top of file
238-
# E501: line too long - let the formatter worry about that
239-
# E731: do not assign a lambda expression, use a def
237+
extend-select = [
238+
"F", # Pyflakes
239+
"E", # pycodestyle errors
240+
"W", # pycodestyle warnings
241+
"I", # isort
242+
"UP", # pyupgrade
243+
"B", # flake8-bugbear
244+
"C4", # flake8-comprehensions
245+
"PIE", # flake8-pie
246+
"TID", # flake8-tidy-imports (absolute imports)
247+
"PGH", # pygrep-hooks
248+
"PERF", # Perflint
249+
"RUF",
250+
]
240251
extend-safe-fixes = [
241-
"TID252", # absolute imports
252+
"TID252", # absolute imports
242253
]
243254
ignore = [
244-
"C40",
245-
"E402",
246-
"E501",
247-
"E731",
248-
"UP007",
249-
"PERF20",
255+
"E402", # module level import not at top of file
256+
"E501", # line too long - let the formatter worry about that
257+
"E731", # do not assign a lambda expression, use a def
258+
"UP007", # use X | Y for type annotations
259+
"UP027", # deprecated
260+
"C40", # unnecessary generator, comprehension, or literal
250261
"PIE790", # unnecessary pass statement
251-
"RUF001",
252-
"RUF002",
253-
"RUF003",
254-
"RUF005",
255-
"RUF012",
256-
]
257-
extend-select = [
258-
"B", # flake8-bugbear
259-
"C4", # flake8-comprehensions
260-
"F", # Pyflakes
261-
"E", # Pycodestyle
262-
"W",
263-
"TID", # flake8-tidy-imports (absolute imports)
264-
"I", # isort
265-
"PERF", # Perflint
266-
"PIE", # flake8-pie
267-
"PGH", # pygrep-hooks
268-
"RUF",
269-
"UP", # Pyupgrade
262+
"PERF203", # try-except within a loop incurs performance overhead
263+
"RUF001", # string contains ambiguous unicode character
264+
"RUF002", # docstring contains ambiguous acute accent unicode character
265+
"RUF003", # comment contains ambiguous no-break space unicode character
266+
"RUF005", # consider upacking operator instead of concatenation
267+
"RUF012", # mutable class attributes
270268
]
271269

270+
272271
[tool.ruff.lint.per-file-ignores]
273272
# don't enforce absolute imports
274273
"asv_bench/**" = ["TID252"]

0 commit comments

Comments
 (0)