Skip to content

chore: fix ruff/black lint drift (CI red on dev/main) - #48

Closed
artemo-brd wants to merge 1 commit into
devfrom
fix/ruff-import-sort
Closed

chore: fix ruff/black lint drift (CI red on dev/main)#48
artemo-brd wants to merge 1 commit into
devfrom
fix/ruff-import-sort

Conversation

@artemo-brd

Copy link
Copy Markdown
Collaborator

Problem

ruff check currently reports 3573 findings and black --check flags 32 files on this repo — reproduced identically on a clean main checkout, so this is pre-existing drift, not caused by any recent PR (found while investigating why PR #47's checks were failing).

Root cause: pyproject.toml declares ruff>=0.1.0 (unpinned) with a [tool.ruff.lint] ignore list but no explicit select. The repo's ignore list (E402, F841) only makes sense for the classic pyflakes/pycodestyle set — but without a pinned select, newer ruff resolves its own broader default (pulls in plugin categories like DTZ/SIM that were never part of this project's intent), on top of thousands of never-enforced import-sort (I001) findings across the codebase.

Fix

  • Added explicit select = ["E4", "E7", "E9", "F", "I"] to [tool.ruff.lint] — restores the classic error/pyflakes/import-sort scope the ignore list was written for, insulated from ruff version drift going forward.
  • ruff check --fix: mechanical import reordering only (3560 auto-fixes), no semantic changes.
  • black (pinned 26.5.1, matches CI): reformatted the 32 drifted files.

Verification

  • ruff check src/ tests/ → clean
  • black --check src/ tests/ → clean
  • pytest tests/unit → 321 passed, unchanged

Purely mechanical — no behavioral changes.

- ruff --fix: sort/organize imports across src/ and tests/ (3560 auto-fixes,
  all mechanical import reordering, no semantic changes)
- pyproject.toml: pin tool.ruff.lint select to [E4, E7, E9, F, I] explicitly.
  Without an explicit select, an unpinned 'ruff>=0.1.0' silently picks up
  its current default rule set, which now includes plugin categories
  (datetimez, simplify, etc.) never intended by this repo's ignore list
  (which only ever suppressed E402/F841). This made 'ruff check' in CI
  fail with 3573 findings unrelated to any recent change.
- black: reformat 32 files that had drifted from the pinned black==26.5.1
  formatting (also pre-existing, reproduced identically on a clean main
  checkout before this branch's changes).

Verified: ruff check and black --check both clean; full unit suite
(321 tests) passes unchanged.
@artemo-brd

Copy link
Copy Markdown
Collaborator Author

Closing for now — this is a repo-wide lint/format cleanup unrelated to the auth-fallback feature (PR #46/#47). Will redo as its own standalone PR against main once #47 is merged, so it doesn't mix with the feature diff.

@artemo-brd artemo-brd closed this Jul 30, 2026
@artemo-brd artemo-brd reopened this Jul 30, 2026
@artemo-brd artemo-brd closed this Jul 30, 2026
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.

1 participant