Skip to content

style: apply ruff format and enforce it in CI - #774

Merged
tempus2016 merged 3 commits into
mainfrom
chore/ruff-format
Aug 10, 2026
Merged

style: apply ruff format and enforce it in CI#774
tempus2016 merged 3 commits into
mainfrom
chore/ruff-format

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

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

  1. test: make the source-text assertions format-insensitive — three tests in test_accessible_design.py and test_pre_reader_mode.py assert against the literal text of select.py and button.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.
  2. style: apply ruff format — pure formatting, 176 files, no behaviour change.
  3. chore(ci): enforce itruff format --check step in lint.yml, ruff-format pre-commit hook, and .git-blame-ignore-revs listing the sweep commit.

Verification

Full suite run on this branch vs. main at 4cf5b81, same machine:

result
main (pre-format) 1540 passed
this branch 1540 passed

The three tests fixed in commit 1 were genuine breakage caused by the reformat, not pre-existing flakes — they pass on main and failed after the sweep until the assertions were loosened. No other test moved.

Also verified: ruff check clean, ruff format --check clean (179 files), actionlint clean.

Notes

  • Blame: GitHub applies .git-blame-ignore-revs to its blame view automatically. Locally, git config blame.ignoreRevsFile .git-blame-ignore-revs once.
  • The diff is large and entirely mechanical; reviewing commit 1 and commit 3 is where the actual decisions are.

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
@tempus2016 tempus2016 added ci CI, workflows, and tooling tests Test suite labels Aug 10, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation backend Python integration code labels Aug 10, 2026
@tempus2016
tempus2016 merged commit a2a39de into main Aug 10, 2026
15 checks passed
@tempus2016
tempus2016 deleted the chore/ruff-format branch August 10, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Python integration code ci CI, workflows, and tooling documentation Improvements or additions to documentation tests Test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant