Skip to content

Commit efa3be4

Browse files
authored
Enable additional ruff lint rules (zero-violation batch) (#1998)
## Summary - Add 15 new ruff rule sets that require no code changes: W, LOG, DTZ, FLY, ISC, PGH, SLF, SLOT, TID, INP, ICN, G, BLE, TRY, Q - Ignore TRY003 globally (long exception messages are idiomatic for domain-specific errors) - Add per-file ignores for tests (SLF001) and utils (INP001, BLE001) - Add noqa for intentional blind except in ActionQueue worker ## Test plan - [x] `ruff check .` passes - [x] `pytest` — 280 tests pass - [x] `mypy` passes
1 parent 3c03719 commit efa3be4

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-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: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ select = [
5353
"ASYNC",
5454
# pycodestyle
5555
"E",
56+
"W",
5657
# Pyflakes
5758
"F",
5859
# pyupgrade
@@ -75,11 +76,43 @@ select = [
7576
"N",
7677
# flake8-pytest-style
7778
"PT",
79+
# flake8-logging
80+
"LOG",
81+
# flake8-datetimez
82+
"DTZ",
83+
# flynt
84+
"FLY",
85+
# flake8-implicit-str-concat
86+
"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
78111
]
79-
ignore = ["E501"] # Line too long
80112

81113
[tool.ruff.lint.per-file-ignores]
82-
"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
83116

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

0 commit comments

Comments
 (0)