Repository navigation
chore(lint): clear ruff SIM/UP backlog (#469 cluster) — closes #491/#492/#493/#496/#497/#503 - #2920
Merged
Merged
Conversation
…ter) Resolves the auto-fixable ruff findings tracked by the #469 baseline-cleanup epic, combined into one PR because they share tests/ruff_audit_baseline.json (regenerated once here) and several source files overlap. - SIM118 (#496): drop redundant .keys() in membership / iteration - UP045 (#503): Optional[X] -> X | None; drop the now-unused Optional import - SIM102/SIM108 (#491, #492, #493, #497): combine nested ifs / use ternaries. 16 sites via `ruff --fix --unsafe-fixes` (every hunk reviewed for behavior and comment preservation); 4 further sites combined by hand; 3 sites kept nested with `# noqa` + rationale because merging would drop an explanatory inline comment or duplicate an existing condition. Lint pinned to ruff==0.16.0 to match CI. tests/ruff_audit_baseline.json regenerated 70 -> 47 keys; `python tests/ruff_audit.py --ci` passes (no new findings, format clean). Closes #491 Closes #492 Closes #493 Closes #496 Closes #497 Closes #503 Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01QBL6TAMVXRUY7iQyy9Ysvi
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Clears the auto-fixable ruff lint backlog tracked by the #469 baseline-cleanup epic, bundled into one PR because the fixes share
tests/ruff_audit_baseline.json(regenerated once here) and several source files overlap. Lint run with ruff==0.16.0 to match CI..keys()in membership / iterationOptional[X]→X | None(+ remove now-unusedOptionalimport)ifs withandif/elseassignment → ternaryHow
ruff check --select SIM102,SIM108,SIM118,UP045 --fix --unsafe-fixes. These rules areunsafe-classified in 0.16.0, so every hunk was reviewed by hand for behavioral equivalence and comment preservation (short-circuit semantics unchanged; no dropped comments).aperture.py,llm_recorder.py,language_lens.py,binary_anomaly_detector.py.# noqa: <rule> — rationalebecause merging would drop an explanatory inline comment or duplicate an existing condition:signal_processor.py(SIM108, 80%-reduction comment),full_api_network_map.py(SIM102, suffix-match comment),language_lens.py(SIM102, redundantSAFE_WRAPPERSguard).ruff_audit_baseline.jsonregenerated: 70 → 47 keys.Verification
python tests/ruff_audit.py --ci→ no new findings beyond the 47-key baseline,ruff format --checkclean.pytestsuite: 8667 passed; the only failures are pre-existingsecurity_auditortests that needxgboost(absent from the local venv, unrelated to this change).Closes #491, closes #492, closes #493, closes #496, closes #497, closes #503
🤖 Generated with Claude Code
https://claude.ai/code/session_01QBL6TAMVXRUY7iQyy9Ysvi