chore(ruff): Add RUF022 and tweak formatting in ruff.toml

Enable `RUF022` to enforce sorted `__all__` lists. Adjust comment
alignment and whitespace for improved readability and consistency
in ruff.toml configuration.
This commit is contained in:
Martin Hauser
2026-02-20 15:34:58 +01:00
parent bb1a44d35b
commit 85d6242962

View File

@@ -35,20 +35,21 @@ target-version = "py312"
# Keeping this explicit makes ruff deterministic.
select = ["E4", "E7", "E9", "F"]
extend-select = [
"E1", # pycodestyle errors: indentation-related (e.g., unexpected/missing indent)
"E2", # pycodestyle errors: whitespace-related (e.g., missing whitespace, extra spaces)
"E3", # pycodestyle errors: blank lines / spacing around definitions
"E501", # pycodestyle: line too long (enforced with `line-length` above)
"W", # pycodestyle warnings (various style warnings, often whitespace/newlines)
"I", # import sorting (isort-equivalent)
"RET", # return semantics (flake8-return family: consistent/explicit returns; remove redundant else/assign before return)
"UP", # pyupgrade: modernize syntax for your target Python (e.g., f-strings, built-in generics, newer stdlib idioms)
"E1", # pycodestyle errors: indentation-related (e.g., unexpected/missing indent)
"E2", # pycodestyle errors: whitespace-related (e.g., missing whitespace, extra spaces)
"E3", # pycodestyle errors: blank lines / spacing around definitions
"E501", # pycodestyle: line too long (enforced with `line-length` above)
"W", # pycodestyle warnings (various style warnings, often whitespace/newlines)
"I", # import sorting (isort-equivalent)
"RET", # return semantics (flake8-return family: consistent/explicit returns; remove redundant else/assign before return)
"UP", # pyupgrade: modernize syntax for your target Python (e.g., f-strings, built-in generics, newer stdlib idioms)
"RUF022", # ruff: enforce sorted `__all__` lists
]
ignore = [
"F403", # pyflakes: `from ... import *` used; unable to detect undefined names
"F405", # pyflakes: name may be undefined or defined from star imports
"RET504", # return: unnecessary assignment before `return` (e.g., `x = expr; return x` -> `return expr`)
"UP032", # pyupgrade: prefer f-strings over `str.format(...)`
"F403", # pyflakes: `from ... import *` used; unable to detect undefined names
"F405", # pyflakes: name may be undefined or defined from star imports
"RET504", # return: unnecessary assignment before `return` (e.g., `x = expr; return x` -> `return expr`)
"UP032", # pyupgrade: prefer f-strings over `str.format(...)`
]
preview = true