Skip to content

ruff: shrink ignore list from 9 rules to 4 (auto-fix + noqa + _prefix)#52

Open
racmac57 wants to merge 1 commit into
mainfrom
ruff/shrink-ignores-auto-fix
Open

ruff: shrink ignore list from 9 rules to 4 (auto-fix + noqa + _prefix)#52
racmac57 wants to merge 1 commit into
mainfrom
ruff/shrink-ignores-auto-fix

Conversation

@racmac57
Copy link
Copy Markdown
Owner

Summary

Shrinks the repo-wide ruff ignore list 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:

Channel Count What changed
ruff check --fix 134 Removed f-prefix from empty f-strings, deleted unused imports where safe, added trailing newlines, cleaned up F811 redefinitions.
Inline # noqa: F401 11 All 11 surviving F401s are intentional try: import foo except ImportError: availability probes in celery_tasks.py, langchain_rag_handler.py, ollama_integration.py, and test_celery_integration.py. Line-level noqa keeps them exempt without broadening the ignore.
_var prefix 10 The F841 unused-local sites. Three picked up inline # TODO comments where the unused assignment hints at a wiring gap worth following up on: celery_tasks file_key (never wired into dedupe lock), orchestrator auth_b64 (computed but never passed to --basic-auth), watcher_splitter cloud_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 — bare except:; real reliability hazard because it swallows KeyboardInterrupt/SystemExit.
  • E741 — ambiguous l/I/O names; rename-only, requires judgment.

Test plan

  • ruff check .All checks passed! locally
  • pytest tests/test_smoke.py → 3 passed
  • CI test-fast green — this is the real proof that the ruff tightening didn't accidentally break any of the 32 modules touched by the auto-fix

Diff stat

46 files changed, +95/-157 (net removal — dead code shed).


Generated by Claude Code

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants