Skip to content

Commit

Permalink
Reorganise ruff rules (#9738)
Browse files Browse the repository at this point in the history
Use the same rule ordering as the ruff documentation:
https://docs.astral.sh/ruff/rules/
  • Loading branch information
DimitriPapadopoulos authored Nov 7, 2024
1 parent 876b73a commit 9b632fd
Showing 1 changed file with 28 additions and 29 deletions.
57 changes: 28 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -234,41 +234,40 @@ extend-exclude = [
]

[tool.ruff.lint]
# E402: module level import not at top of file
# E501: line too long - let the formatter worry about that
# E731: do not assign a lambda expression, use a def
extend-select = [
"F", # Pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"PIE", # flake8-pie
"TID", # flake8-tidy-imports (absolute imports)
"PGH", # pygrep-hooks
"PERF", # Perflint
"RUF",
]
extend-safe-fixes = [
"TID252", # absolute imports
"TID252", # absolute imports
]
ignore = [
"C40",
"E402",
"E501",
"E731",
"UP007",
"PERF20",
"E402", # module level import not at top of file
"E501", # line too long - let the formatter worry about that
"E731", # do not assign a lambda expression, use a def
"UP007", # use X | Y for type annotations
"UP027", # deprecated
"C40", # unnecessary generator, comprehension, or literal
"PIE790", # unnecessary pass statement
"RUF001",
"RUF002",
"RUF003",
"RUF005",
"RUF012",
]
extend-select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"F", # Pyflakes
"E", # Pycodestyle
"W",
"TID", # flake8-tidy-imports (absolute imports)
"I", # isort
"PERF", # Perflint
"PIE", # flake8-pie
"PGH", # pygrep-hooks
"RUF",
"UP", # Pyupgrade
"PERF203", # try-except within a loop incurs performance overhead
"RUF001", # string contains ambiguous unicode character
"RUF002", # docstring contains ambiguous acute accent unicode character
"RUF003", # comment contains ambiguous no-break space unicode character
"RUF005", # consider upacking operator instead of concatenation
"RUF012", # mutable class attributes
]


[tool.ruff.lint.per-file-ignores]
# don't enforce absolute imports
"asv_bench/**" = ["TID252"]
Expand Down

0 comments on commit 9b632fd

Please sign in to comment.