Skip to content

Commit a2ff24f

Browse files
Reorganise ruff rules
Use the same rule ordering as the ruff documentation: https://docs.astral.sh/ruff/rules/
1 parent 8aab23e commit a2ff24f

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

pyproject.toml

+22-24
Original file line numberDiff line numberDiff line change
@@ -234,34 +234,32 @@ 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+
"TID", # flake8-tidy-imports (absolute imports)
245+
"PGH", # pygrep-hooks
246+
"RUF",
247+
]
240248
extend-safe-fixes = [
241249
"TID252", # absolute imports
242250
]
243251
ignore = [
244-
"E402",
245-
"E501",
246-
"E731",
247-
"UP007",
248-
"RUF001",
249-
"RUF002",
250-
"RUF003",
251-
"RUF005",
252-
"RUF007",
253-
"RUF012",
254-
]
255-
extend-select = [
256-
"B", # flake8-bugbear
257-
"F", # Pyflakes
258-
"E", # Pycodestyle
259-
"W",
260-
"TID", # flake8-tidy-imports (absolute imports)
261-
"I", # isort
262-
"PGH", # pygrep-hooks
263-
"RUF",
264-
"UP", # Pyupgrade
252+
"E402", # module level import not at top of file
253+
"E501", # line too long - let the formatter worry about that
254+
"E731", # do not assign a lambda expression, use a def
255+
"UP007", # use X | Y for type annotations
256+
"UP027", # deprecated
257+
"RUF001", # string contains ambiguous unicode character
258+
"RUF002", # docstring contains ambiguous acute accent unicode character
259+
"RUF003", # comment contains ambiguous no-break space unicode character
260+
"RUF005", # consider upacking operator instead of concatenation
261+
"RUF007", # prefer itertools.pairwise() over zip()
262+
"RUF012", # mutable class attributes
265263
]
266264

267265
[tool.ruff.lint.per-file-ignores]

0 commit comments

Comments
 (0)