From 85d6242962cec131de073751371ebe3be8d29b5f Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Fri, 20 Feb 2026 15:34:58 +0100 Subject: [PATCH] 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. --- ruff.toml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/ruff.toml b/ruff.toml index a9c2b4b01..e696c3627 100644 --- a/ruff.toml +++ b/ruff.toml @@ -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