Skip to content

Commit 7ee839f

Browse files
committed
Enable 10 additional ruff lint rules with zero code changes
Add PGH, SLF, SLOT, TID, INP, ICN, G, BLE, TRY, and Q rule sets. Ignore TRY003 globally (long exception messages are idiomatic here). Add per-file ignores for tests (SLF001) and utils (INP001, BLE001). Add noqa for intentional blind except in ActionQueue worker.
1 parent 0b67929 commit 7ee839f

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

pyoverkiz/action_queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ async def _execute_batch(
284284
for waiter in waiters:
285285
waiter.set_exception(exc)
286286
raise
287-
except Exception as exc:
287+
except Exception as exc: # noqa: BLE001
288288
# Propagate exceptions to all waiters without swallowing system-level exits.
289289
for waiter in waiters:
290290
waiter.set_exception(exc)

pyproject.toml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,35 @@ select = [
8484
"FLY",
8585
# flake8-implicit-str-concat
8686
"ISC",
87+
# pygrep-hooks
88+
"PGH",
89+
# flake8-self
90+
"SLF",
91+
# flake8-slots
92+
"SLOT",
93+
# tidy imports
94+
"TID",
95+
# flake8-no-pep420
96+
"INP",
97+
# import conventions
98+
"ICN",
99+
# flake8-logging-format
100+
"G",
101+
# blind exception
102+
"BLE",
103+
# tryceratops
104+
"TRY",
105+
# flake8-quotes
106+
"Q",
107+
]
108+
ignore = [
109+
"E501", # Line too long
110+
"TRY003", # Long exception messages are acceptable for domain-specific errors
87111
]
88-
ignore = ["E501"] # Line too long
89112

90113
[tool.ruff.lint.per-file-ignores]
91-
"tests/**" = ["S101"] # Allow assert in tests
114+
"tests/**" = ["S101", "SLF001"] # Allow assert and private member access in tests
115+
"utils/**" = ["INP001", "BLE001"] # Utils are scripts, not packages
92116

93117
[tool.ruff.lint.pydocstyle]
94118
convention = "google" # Accepts: "google", "numpy", or "pep257".

0 commit comments

Comments
 (0)