From 7c5ba272366d6c268317124725033581245529bf Mon Sep 17 00:00:00 2001 From: Max Derner Date: Thu, 25 Jun 2026 16:11:35 +0100 Subject: [PATCH 1/5] sorted rules --- pyproject.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 32d09df..6de9c3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,19 +31,19 @@ indent-width = 4 [tool.ruff.lint] select = [ - "RUF", # Ruff specific rules - "N", # pep8-naming - "I", # isort - "F", # pyflakes - "UP", # pyupgrade - "E", # pycodestyle errors - "W", # pycodestyle warnings + "A", # flake8-builtins "ANN", # flake8-annotations - "S", # flake8-bandit "B", # flake8-bugbear - "A", # flake8-builtins "C4", # flake8-comprehensions "DTZ", # flake8-datetimez + "E", # pycodestyle errors + "F", # pyflakes + "I", # isort + "N", # pep8-naming + "RUF", # Ruff specific rules + "S", # flake8-bandit + "UP", # pyupgrade + "W", # pycodestyle warnings ] ignore = [ From 230f1c7d255e31d1b12e66719e95b6e8efa8a1d1 Mon Sep 17 00:00:00 2001 From: Max Derner Date: Thu, 25 Jun 2026 16:12:38 +0100 Subject: [PATCH 2/5] Added links for rules --- pyproject.toml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6de9c3f..421e68c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,19 +31,19 @@ indent-width = 4 [tool.ruff.lint] select = [ - "A", # flake8-builtins - "ANN", # flake8-annotations - "B", # flake8-bugbear - "C4", # flake8-comprehensions - "DTZ", # flake8-datetimez - "E", # pycodestyle errors - "F", # pyflakes - "I", # isort - "N", # pep8-naming - "RUF", # Ruff specific rules - "S", # flake8-bandit - "UP", # pyupgrade - "W", # pycodestyle warnings + "A", # flake8-builtins ---------------> https://docs.astral.sh/ruff/rules/#flake8-builtins-a + "ANN", # flake8-annotations ------------> https://docs.astral.sh/ruff/rules/#flake8-annotations-ann + "B", # flake8-bugbear ----------------> https://docs.astral.sh/ruff/rules/#flake8-bugbear-b + "C4", # flake8-comprehensions ---------> https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4 + "DTZ", # flake8-datetimez --------------> https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz + "E", # pycodestyle errors ------------> https://docs.astral.sh/ruff/rules/#error-e + "F", # pyflakes ----------------------> https://docs.astral.sh/ruff/rules/#pyflakes-f + "I", # isort -------------------------> https://docs.astral.sh/ruff/rules/#isort-i + "N", # pep8-naming -------------------> https://docs.astral.sh/ruff/rules/#pep8-naming-n + "RUF", # Ruff specific rules -----------> https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf + "S", # flake8-bandit -----------------> https://docs.astral.sh/ruff/rules/#flake8-bandit-s + "UP", # pyupgrade ---------------------> https://docs.astral.sh/ruff/rules/#pyflakes-f + "W", # pycodestyle warnings ----------> https://docs.astral.sh/ruff/rules/#warning-w ] ignore = [ From 7a0f8f8a904f8a80b1edeb897f1a0d88ee54d41f Mon Sep 17 00:00:00 2001 From: Max Derner Date: Thu, 25 Jun 2026 16:13:51 +0100 Subject: [PATCH 3/5] sensible rule additions --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 421e68c..d320b03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,13 +35,17 @@ select = [ "ANN", # flake8-annotations ------------> https://docs.astral.sh/ruff/rules/#flake8-annotations-ann "B", # flake8-bugbear ----------------> https://docs.astral.sh/ruff/rules/#flake8-bugbear-b "C4", # flake8-comprehensions ---------> https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4 + "C90", # mccabe complexity -------------> https://docs.astral.sh/ruff/rules/#mccabe-c90 "DTZ", # flake8-datetimez --------------> https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz "E", # pycodestyle errors ------------> https://docs.astral.sh/ruff/rules/#error-e + "ERA", # eradicate ---------------------> https://docs.astral.sh/ruff/rules/#eradicate-era "F", # pyflakes ----------------------> https://docs.astral.sh/ruff/rules/#pyflakes-f "I", # isort -------------------------> https://docs.astral.sh/ruff/rules/#isort-i + "LOG", # flake8-logging ---------------> https://docs.astral.sh/ruff/rules/#flake8-logging-log "N", # pep8-naming -------------------> https://docs.astral.sh/ruff/rules/#pep8-naming-n "RUF", # Ruff specific rules -----------> https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf "S", # flake8-bandit -----------------> https://docs.astral.sh/ruff/rules/#flake8-bandit-s + "TRY", # tryceratops -------------------> https://docs.astral.sh/ruff/rules/#tryceratops-try "UP", # pyupgrade ---------------------> https://docs.astral.sh/ruff/rules/#pyflakes-f "W", # pycodestyle warnings ----------> https://docs.astral.sh/ruff/rules/#warning-w ] From bedb5a98eed31bef51ed5d0c56177a1f0f7638e4 Mon Sep 17 00:00:00 2001 From: Max Derner Date: Thu, 25 Jun 2026 16:14:34 +0100 Subject: [PATCH 4/5] sensible ignores --- pyproject.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d320b03..c0688a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,10 +53,16 @@ select = [ ignore = [ "E501", # line-too-long "T201", # print - "S101", # use of assert + "ANN002", # missing type annotation for args "ANN003", # missing type annotation for kwargs ] +[lint.extend-per-file-ignores] +"tests/**/test*.py" = [ # in tests files ignore: + "S101", # - use of `assert` + "TRY002", # - rasing vanilla exceptions +] + [tool.ruff.lint.isort] combine-as-imports = true From b8970b9858792fc398550f939b1350d7da7b8e59 Mon Sep 17 00:00:00 2001 From: Max Derner Date: Fri, 26 Jun 2026 09:33:46 +0100 Subject: [PATCH 5/5] Additional tidy up: * removed the ignore for T201 as we are not enforcing that ruleset anyway * added clarifying comments for the remaining ignored rules --- pyproject.toml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c0688a6..f5ab924 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,16 +51,15 @@ select = [ ] ignore = [ - "E501", # line-too-long - "T201", # print - "ANN002", # missing type annotation for args - "ANN003", # missing type annotation for kwargs + "ANN002", # missing type annotation for *args ------> https://docs.astral.sh/ruff/rules/missing-type-args/ + "ANN003", # missing type annotation for **kwargs----> https://docs.astral.sh/ruff/rules/missing-type-kwargs/ + "E501", # line-too-long --------------------------> https://docs.astral.sh/ruff/rules/line-too-long/ ] [lint.extend-per-file-ignores] "tests/**/test*.py" = [ # in tests files ignore: - "S101", # - use of `assert` - "TRY002", # - rasing vanilla exceptions + "S101", # - use of `assert` ---------------> https://docs.astral.sh/ruff/rules/assert/ + "TRY002", # - rasing vanilla exceptions -----> https://docs.astral.sh/ruff/rules/raise-vanilla-class/ ] [tool.ruff.lint.isort]