Repository navigation
ci: run ruff from uv.lock in CI and pre-commit - #183
Merged
Merged
Conversation
CI used unpinned `uvx ruff` (latest on PyPI), pre-commit pinned ruff-pre-commit at v0.15.4 (not tracked by Dependabot), and uv.lock held 0.15.15. Make uv.lock the single source of truth so Dependabot uv bumps move all three together. - Add a `lint` dependency group with ruff; `dev` includes it. - CI lint job: `uv sync --locked --only-group lint`, then `uv run --no-sync ruff ...`. - pre-commit: replace ruff-pre-commit with local `uv run ruff` hooks, matching the existing local ty hook. - Update CONTRIBUTING.md and the PR template to `uv run ruff`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
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.
Summary
Ruff currently runs at three different versions:
uvx ruffuv.lock/uv runruff-pre-commitrev, not tracked by DependabotThis PR makes
uv.lockthe single source of truth, so a Dependabot uv bump (e.g. #180) moves all three together.Changes
lintdependency group (ruff>=0.8), whichdevincludes, matching the existingtypecheckgroup.uv.lockchanges only in group metadata; ruff stays at 0.15.15.uv sync --locked --only-group lint, thenuv run --no-sync ruff check/format.--only-groupinstalls only ruff (not the project or its test/doc deps).--lockedfails if the lock is stale.ruff-pre-commitis replaced withrepo: localhooks (language: system,entry: uv run ruff ...), mirroring the existing localtyhook. Keptexclude: ^examples/on the check hook, plus--force-excludeandrequire_serialfrom the upstream hook definitions. Only the ruff section changed, so this should merge cleanly with ci(ci): pin commitlint once and run the same hook in CI #181 (which touches the commitlint hook only).uvx ruff→uv run ruff.Verification
uv sync --locked --only-group lintinstalls onlyruff==0.15.15.ruff check src/ tests/passes, andruff format --check src/ tests/reports all 62 files already formatted.ruffandruff-formathooks pass on all files undersrc/andtests/.uvx pre-commit run --all-filesdoes not pass, but this is pre-existing. The old config (ruff-pre-commit v0.15.4) gives exactly the same results ondevelop: 2B905errors inparity/scripts/, 20 files reformatted underexamples/andparity/, and end-of-file fixes in twotests/resources/*.jsonfixtures. This PR doesn't fix them, to keep it focused.Note on the version jump
Until now, CI has been linting with ruff 0.17.x. After this PR it uses 0.15.15 until #180 lands. Once #180 merges, all three run 0.17.0.
🤖 Generated with Claude Code