ruff: shrink ignore list from 9 rules to 4 (auto-fix + noqa + _prefix)#52
Open
racmac57 wants to merge 1 commit into
Open
ruff: shrink ignore list from 9 rules to 4 (auto-fix + noqa + _prefix)#52racmac57 wants to merge 1 commit into
racmac57 wants to merge 1 commit into
Conversation
Applied `ruff check --fix` and targeted manual cleanup to drop F401, F541, F811, F841, and W292 from the repo-wide ignore list. Any new violation of those rules now fails CI on test-fast. - 134 findings auto-fixed (F541 redundant f-strings, most F401 unused imports, F811 redefinitions, W292 missing trailing newlines). - 11 remaining F401 sites annotated inline with `# noqa: F401` — all are intentional availability-probe imports inside try/except ImportError blocks (celery_tasks, langchain_rag_handler, ollama_integration, test_celery_integration). - 10 F841 sites converted to `_var` prefix. Three flagged with inline TODO comments where the unused assignment hints at a real wiring gap (celery_tasks file_key, orchestrator auth_b64, watcher_splitter cloud_success — the retry-success signal is set but the caller never reads it). Remaining ignores: E402 (53× intentional lazy imports), E501 (long lines), E722 (16× bare except — separate cleanup), E741 (ambiguous names). Each of those wants its own PR.
This was referenced Apr 24, 2026
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.
Summary
Shrinks the repo-wide ruff
ignorelist from 9 rules → 4. The dropped rules (F401, F541, F811, F841, W292) will now fail CI if any future PR re-introduces them.How the 155 baseline findings were cleared:
ruff check --fix# noqa: F401try: import foo except ImportError:availability probes incelery_tasks.py,langchain_rag_handler.py,ollama_integration.py, andtest_celery_integration.py. Line-level noqa keeps them exempt without broadening the ignore._varprefix# TODOcomments where the unused assignment hints at a wiring gap worth following up on:celery_tasksfile_key(never wired into dedupe lock),orchestratorauth_b64(computed but never passed to--basic-auth),watcher_splittercloud_success(retry-success signal is set but no caller reads it).Remaining ignores in
ruff.toml— each wants its own follow-up:E402× 53 — module-level import not at top; mostly intentional lazy imports behind feature flags.E501— long lines; cosmetic.E722× 16 — bareexcept:; real reliability hazard because it swallowsKeyboardInterrupt/SystemExit.E741— ambiguousl/I/Onames; rename-only, requires judgment.Test plan
ruff check .→All checks passed!locallypytest tests/test_smoke.py→ 3 passedtest-fastgreen — this is the real proof that the ruff tightening didn't accidentally break any of the 32 modules touched by the auto-fixDiff stat
46 files changed, +95/-157 (net removal — dead code shed).
Generated by Claude Code