Skip to content

Commit e10a681

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 f292c3e commit e10a681

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
@@ -82,11 +82,35 @@ select = [
8282
"FLY",
8383
# flake8-implicit-str-concat
8484
"ISC",
85+
# pygrep-hooks
86+
"PGH",
87+
# flake8-self
88+
"SLF",
89+
# flake8-slots
90+
"SLOT",
91+
# tidy imports
92+
"TID",
93+
# flake8-no-pep420
94+
"INP",
95+
# import conventions
96+
"ICN",
97+
# flake8-logging-format
98+
"G",
99+
# blind exception
100+
"BLE",
101+
# tryceratops
102+
"TRY",
103+
# flake8-quotes
104+
"Q",
105+
]
106+
ignore = [
107+
"E501", # Line too long
108+
"TRY003", # Long exception messages are acceptable for domain-specific errors
85109
]
86-
ignore = ["E501"] # Line too long
87110

88111
[tool.ruff.lint.per-file-ignores]
89-
"tests/**" = ["S101"] # Allow assert in tests
112+
"tests/**" = ["S101", "SLF001"] # Allow assert and private member access in tests
113+
"utils/**" = ["INP001", "BLE001"] # Utils are scripts, not packages
90114

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

0 commit comments

Comments
 (0)