chore: fix ruff/black lint drift (CI red on dev/main) - #48
Closed
artemo-brd wants to merge 1 commit into
Closed
Conversation
- 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.
Collaborator
Author
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.
Problem
ruff checkcurrently reports 3573 findings andblack --checkflags 32 files on this repo — reproduced identically on a cleanmaincheckout, 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.tomldeclaresruff>=0.1.0(unpinned) with a[tool.ruff.lint]ignorelist but no explicitselect. The repo's ignore list (E402,F841) only makes sense for the classic pyflakes/pycodestyle set — but without a pinnedselect, newer ruff resolves its own broader default (pulls in plugin categories likeDTZ/SIMthat were never part of this project's intent), on top of thousands of never-enforced import-sort (I001) findings across the codebase.Fix
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(pinned26.5.1, matches CI): reformatted the 32 drifted files.Verification
ruff check src/ tests/→ cleanblack --check src/ tests/→ cleanpytest tests/unit→ 321 passed, unchangedPurely mechanical — no behavioral changes.