Skip to content

Commit 7e8a57b

Browse files
committed
Move PLW0717 to per-file ignores instead of global ignore
Suppresses too-many-statements-in-try-clause only in the files that actually trigger it, rather than globally. Test files are also covered. Global suppression masked the rule entirely; per-file ignores leave it active elsewhere and make the FIXMEs more targeted.
1 parent 323f3b9 commit 7e8a57b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.ruff.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ ignore = [
101101
"PLR6104", # non-augmented-assignment # FIXME
102102
"PLR6301", # no-self-use # FIXME / noqa
103103

104-
"PLW0717", # too-many-statements-in-try-clause # FIXME
105104
"PLW1514", # unspecified-encoding # FIXME
106105

107106
"PTH100", # os-path-abspath # FIXME
@@ -208,12 +207,19 @@ testing = [
208207

209208

210209
[lint.per-file-ignores]
210+
# Too many statements in try clause — FIXME: narrow these try blocks
211+
"cheroot/connections.py" = ["PLW0717"]
212+
"cheroot/server.py" = ["PLW0717"]
213+
"cheroot/ssl/pyopenssl.py" = ["PLW0717"]
214+
"cheroot/wsgi.py" = ["PLW0717"]
215+
211216
# Exceptions for test files
212217
"cheroot/test/**.py" = [
213218
"ARG002", # Allow unused arguments in instance methods (required for test stubs)
214219
"ARG004", # unused-static-method-argument (hit in WSGI test apps)
215220
"PLC2701", # Allow importing internal files needed for testing
216221
# "PLR6301", # Allow 'self' parameter in method definitions (required for test stubs)
222+
"PLW0717", # too-many-statements-in-try-clause # FIXME
217223
"S101", # Allow use of `assert` in test files
218224
"S404", # Allow importing 'subprocess' module to testing call external tools needed by these hooks
219225
"S603", # subprocess-without-shell-equals-true

0 commit comments

Comments
 (0)