Bump ruff to 0.15.22 and repair the lint gate - #2789
Open
symroe wants to merge 4 commits into
Open
Conversation
Version bump only, from 0.2.2. No code changes -- format and lint failures introduced by this bump are addressed in the following commits. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Result of running `ruff format .` with 0.15.22. Mechanical only -- no behavioural changes. 51 files reformatted, 1013 files left unchanged Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Result of running `ruff check --fix .` with 0.15.22. Safe fixes only; `--unsafe-fixes` was not used. Any remaining violations need manual review and are listed in the PR description. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pytest-ruff 0.2.1 invoked `ruff check --show-source`, an argument removed in
ruff 0.5.0. Against ruff 0.15.22 that call fails with exit code 2 and writes
to stderr, but 0.2.1 only inspects stdout:
stdout, _ = child.communicate()
if stdout:
raise RuffError(stdout.decode())
Empty stdout meant no error was ever raised, so every ruff test reported
PASSED regardless of violations -- the lint gate was a no-op.
0.5 checks the return code and raises on both 1 and 2.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Bumps ruff from 0.2.2 to 0.15.22. Largest job in the rollout.
946864184de8256b6cruff format .— 51 of 1064 files. Mechanical.3cb04e495ruff check --fix .— 21 found, 2 fixed.5f8329183pytest-ruff0.2.1 to 0.5 — repairs the lint gate.The pre-commit rev moved from
v0.2.2tov0.15.22to match.Branch is
ruff-0.15.22with a hyphen: a local branch namedruffalreadyexists in this repo, which makes
ruff/0.15.22an illegal ref.The lint gate was a no-op
pytest-ruff0.2.1 shells out toruff check --show-source— an argumentremoved in ruff 0.5.0 — and then only inspects stdout, discarding stderr and
the exit code. Against ruff 0.15.22 the call exits 2 with nothing on stdout,
so every ruff test passed regardless of violations. 0.5 checks the return
code. Expect CI to go red on this PR.
Still failing after this PR — 19 violations
Start with F507 — it is a real bug, not a style issue:
A
%-format string with 0 placeholders but 1 substitution raisesTypeError: not all arguments converted during string formattingatruntime. Worth checking whether that template tag is reached.
SIM115 (5) — resource leaks, worth fixing properly:
E721 (2) — type comparison with
==rather thanis/isinstance:SIM103 (10) — style, unsafe fixes only:
10 of the 19 have unsafe fixes available; the rest need manual work.
ruff format --check .is clean (1064 files).Part of the org-wide rollout moving every DemocracyClub repo onto ruff
0.15.22. Commits are deliberately split so each step reviews on its own — please review commit by commit rather than as a combined diff.