You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Work down the "real bug-shaped" slice of the ruff lint baseline (#469) -- unused arguments/variables, mutable default gotchas, and silent exception swallowing.
Rule
Count
What it flags
`ARG002`
14
unused method argument
`S110`
22
`try`/`except`/`pass` with no logging
`RUF012`
5
mutable default value in a class attribute (the classic "shared mutable default" footgun)
`B007`
5
loop control variable never used inside the loop body
`ARG001`
4
unused function argument
`RUF059`
3
a variable unpacked from a tuple/etc. but never used
`F841`
2
assigned but never used local variable
55 findings total.
Approach
`S110` is the largest bucket here, and a heads-up on scope: many of these are almost certainly this codebase's deliberate `except Exception: pass` fault-isolation pattern (skip a malformed regex match, continue scanning the rest of the file) documented throughout as "DEFENSIVE ARCHITECTURE" -- see the rationale in #469 for why `BLE001` (a stricter, more disruptive version of this same idea) was excluded from the rule selection entirely. `S110`'s ask is much cheaper though: add a `self.logger.debug(...)` line inside the `except`, not restructure the exception handling. That's almost always the right fix here, not suppression.
`ARG001`/`ARG002` findings should be checked against interface/override requirements first (an unused `self` or an intentionally-unused override parameter isn't a bug) before assuming it's dead.
Fix in small PRs, removing resolved entries from `tests/ruff_audit_baseline.json` (#469) as each is resolved.
S110 (22/22) done in #476 -- also fixed a real data-integrity issue found while tracing through the pattern: `network_risk_sensor.py`'s macro network metrics (modularity/assortativity/cyclic_density/avg_path_length/articulation_points) were silently defaulting to `0.0`/`0` on computation failure, indistinguishable from a genuine zero measurement. Now default to `None` (matching the existing `zero_dependency_mode` convention), with consumers no longer papering over that with their own fallback. See #476 for the full writeup.
Activity
Fix all 22 S110 (try-except-pass) findings; network metrics now repor…
squid-protocol commentedon Jul 25, 2026
S110 (22/22) done in #476 -- also fixed a real data-integrity issue found while tracing through the pattern: `network_risk_sensor.py`'s macro network metrics (modularity/assortativity/cyclic_density/avg_path_length/articulation_points) were silently defaulting to `0.0`/`0` on computation failure, indistinguishable from a genuine zero measurement. Now default to `None` (matching the existing `zero_dependency_mode` convention), with consumers no longer papering over that with their own fallback. See #476 for the full writeup.
Remaining in this issue's scope: `ARG001`/`ARG002` (unused args, 18), `RUF012` (mutable class defaults, 5), `B007` (unused loop vars, 5), `RUF059` (unused unpacked vars, 3), `F841` (unused locals, 2) -- 33 findings.
Baseline: 241 -> 217.
Fix remaining 33 findings in squid-protocol#473 (ARG001/ARG002/RUF012…