Linting Exception Audit
Audit from mq-rest-admin-project/mq-rest-admin-common#118.
Current Exceptions (~80 total)
Config-Level (14)
- 4 global ruff ignores:
E501 (formatter handles), D203/D213 (docstring preference), COM812 (formatter conflict)
- 6 per-file ignores: tests (
D1, S101, S105, S106), examples (INP001, T201)
- mypy: strict mode, all checks enabled — no exceptions
Source Code Inline (7)
- 2×
S105 — hardcoded string constants (error messages, not secrets)
- 1×
PLR2004 — HTTP 400 status code threshold
- 1×
PLR0913 — session constructor with 7 params
- 3×
pragma: no cover — abstract NotImplementedError stubs in base classes
Test Code Inline (~60)
- ~38×
SLF001 — private member access for unit testing internals
- ~12×
type: ignore — frozen dataclass mutation testing, dynamic kwargs, untyped test data
- 6×
PLR2004 — magic number literals in assertions
- 2×
ARG002 — unused callback fixture params
- 1×
S603/S607 — subprocess in integration test
Actionable Items
Quick Win: Move SLF001 to per-file-ignores (~15 min)
Add SLF001 to the existing per-file-ignores block in pyproject.toml:
"tests/**/*.py" = [
"D1", # Tests do not require docstrings
"S101", # Pytest assert style is expected
"S105", # Hardcoded test passwords
"S106", # Hardcoded test password arguments
"SLF001", # Tests legitimately access private members for unit testing
]
Then remove all 38 inline # noqa: SLF001 comments from test files. This follows the same pattern already used for S101/S105/S106.
Eliminates: 38 inline suppressions
Not Actionable
All remaining exceptions are justified:
S105 on error message constants (not secrets)
PLR2004 on HTTP status codes and test assertions
PLR0913 on session constructor (inherent complexity)
pragma: no cover on abstract method stubs (unreachable by design)
type: ignore in tests (frozen dataclass mutation, Mockito-style patterns)
ARG002 in test fixtures (callback signatures)
Linting Exception Audit
Audit from mq-rest-admin-project/mq-rest-admin-common#118.
Current Exceptions (~80 total)
Config-Level (14)
E501(formatter handles),D203/D213(docstring preference),COM812(formatter conflict)D1,S101,S105,S106), examples (INP001,T201)Source Code Inline (7)
S105— hardcoded string constants (error messages, not secrets)PLR2004— HTTP 400 status code thresholdPLR0913— session constructor with 7 paramspragma: no cover— abstractNotImplementedErrorstubs in base classesTest Code Inline (~60)
SLF001— private member access for unit testing internalstype: ignore— frozen dataclass mutation testing, dynamic kwargs, untyped test dataPLR2004— magic number literals in assertionsARG002— unused callback fixture paramsS603/S607— subprocess in integration testActionable Items
Quick Win: Move SLF001 to per-file-ignores (~15 min)
Add
SLF001to the existingper-file-ignoresblock inpyproject.toml:Then remove all 38 inline
# noqa: SLF001comments from test files. This follows the same pattern already used forS101/S105/S106.Eliminates: 38 inline suppressions
Not Actionable
All remaining exceptions are justified:
S105on error message constants (not secrets)PLR2004on HTTP status codes and test assertionsPLR0913on session constructor (inherent complexity)pragma: no coveron abstract method stubs (unreachable by design)type: ignorein tests (frozen dataclass mutation, Mockito-style patterns)ARG002in test fixtures (callback signatures)