chore(ruff): pin ruff hook and dependency to 0.14.8 - #5
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
`.pre-commit-config.yaml` pinned `ruff-pre-commit` at v0.16.5 while
`uv.lock` resolved ruff 0.14.8, so the hook and CI ran different ruff
versions against the same files.
Measured: with the 0.16.5 hook and the 0.14.8 lock, `prek run --all-files`
deletes the justified `# noqa: PLC0415` suppressions in
`packages/ensure_uv/version.py` (rewriting one into the 0.16-only
`# ruff: ignore[import-outside-top-level]` spelling) and then reports the
PLC0415 violations it just unsuppressed.
Bumping the dependency up to 0.16.5 does not fix it: 0.16.5 deletes its
own suppressions under `unsafe-fixes = true` and the gate stays red with
the same 16 errors. So the hook is pinned down to the locked version
instead, matching the mkapidocs precedent.
`ruff` also moves from `>=0.14.8` to `==0.14.8` so the locked version
cannot float away from the hook rev on the next `uv lock --upgrade`.
Note that the `mxr/sync-pre-commit-deps` hook configured here cannot
police this: its source hardcodes `SUPPORTED = frozenset(('black',
'flake8', 'mypy'))` and it only rewrites `additional_dependencies`
entries inside `.pre-commit-config.yaml` — it never reads `pyproject.toml`
or `uv.lock`. Keeping the two in step remains manual.
Verified: `uv run prek run --all-files` passes with a clean tree.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QJeBLNA9ybmQvv5REMDkrc
Jamie-BitFlight
force-pushed
the
chore/ruff-lock-parity
branch
from
August 31, 2026 08:10
f9fae2c to
30dd6bf
Compare
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
.pre-commit-config.yamlpinnedruff-pre-commitat v0.16.5 whileuv.lockresolved ruff 0.14.8. The hook and CI therefore ran different ruff versions over the same files.Measured on a clean checkout of
origin/main:The 0.16.5 hook deletes the justified
# noqa: PLC0415suppressions inpackages/ensure_uv/version.py— rewriting one into the 0.16-only# ruff: ignore[import-outside-top-level]spelling that 0.14.8 does not understand — and then reports the PLC0415 violations it just unsuppressed.Direction: pin the hook down, not the dependency up
Bumping the dependency to 0.16.5 was tried first and does not fix it: with both sides on 0.16.5 the hook still deletes its own suppressions under
unsafe-fixes = trueand the gate stays red with the same 16 errors. Pinning the hook down to the locked 0.14.8 is the direction that leaves the repo green, matching the mkapidocs precedent.ruff>=0.14.8→ruff==0.14.8So the locked version cannot float away from the hook rev on the next
uv lock --upgrade.mxr/sync-pre-commit-depscannot police this. It is configured in this repo, but its source hardcodes:and it only rewrites
additional_dependenciesentries inside.pre-commit-config.yaml. It never readspyproject.tomloruv.lock, and it does not handle ruff at all. Measured directly: withruff==0.15.3pinned and the hook left at v0.16.5 in a sibling repo, the hook reportsPassedand rewrites nothing. Keeping hook and lock in step is manual.Verification
🤖 Generated with Claude Code
https://claude.ai/code/session_01QJeBLNA9ybmQvv5REMDkrc