style: apply ruff format and enforce it in CI - #774
Merged
Conversation
Three tests assert against the raw text of select.py and button.py. Both assertions are about behaviour (design ids staying in sync, the icon fallback keying on falsiness) but were written against one exact rendering of the source, so any reformat breaks them. Whitespace- and quote-normalise before matching. Passes with or without the formatter run in the next commit.
Pure formatting — no behaviour change. 176 files reformatted, full test suite unchanged at 1540 passed. Listed in .git-blame-ignore-revs so this commit does not obscure blame.
- lint.yml gains a 'ruff format --check' step alongside 'ruff check' - pre-commit gains the ruff-format hook - .git-blame-ignore-revs lists the sweep commit; GitHub applies it to blame automatically, locally set blame.ignoreRevsFile to get the same
Merged
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.
Item 11 from the tooling list, kept separate from #772 so the reformat noise stays isolated and blame-ignorable.
What is here, in three commits
test:make the source-text assertions format-insensitive — three tests intest_accessible_design.pyandtest_pre_reader_mode.pyassert against the literal text ofselect.pyandbutton.py. Both assertions are about behaviour (design ids staying in sync; the icon fallback keying on falsiness rather than attribute-absence) but were written against one exact rendering of the source, so any reformat broke them. Now whitespace- and quote-normalised. Passes with or without the formatter.style:applyruff format— pure formatting, 176 files, no behaviour change.chore(ci):enforce it —ruff format --checkstep inlint.yml,ruff-formatpre-commit hook, and.git-blame-ignore-revslisting the sweep commit.Verification
Full suite run on this branch vs.
mainat4cf5b81, same machine:main(pre-format)The three tests fixed in commit 1 were genuine breakage caused by the reformat, not pre-existing flakes — they pass on
mainand failed after the sweep until the assertions were loosened. No other test moved.Also verified:
ruff checkclean,ruff format --checkclean (179 files),actionlintclean.Notes
.git-blame-ignore-revsto its blame view automatically. Locally,git config blame.ignoreRevsFile .git-blame-ignore-revsonce.