Repository navigation
fix: make pre-commit run --all-files pass and stop format drift - #185
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>
Both _compare helpers return early when list lengths differ, so the zip always sees equal-length inputs. strict=True states that invariant and satisfies ruff B905. The scripts are also run through ruff format, which they had drifted from because CI never checked parity/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI only checked formatting under src/ and tests/, so these drifted. The pre-commit hygiene hooks also fixed trailing whitespace and final newlines in a few of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixtures are only read through json.loads, so the trailing newline added by end-of-file-fixer does not change any test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The format step had continue-on-error set, so drift never failed the build. Everything is formatted now, so drop it and widen the check to examples/ and parity/. Lint parity/ too; examples/ stays out of lint, matching the pre-commit ruff hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ruff 0.17 formats Python code blocks inside Markdown, and the format check now covers examples/, so the Dependabot ruff 0.17.0 bump would fail Lint on this file. Apply its formatting (PEP 8 blank lines around the top-level function) now. ruff 0.15 skips Markdown, so this passes on the currently locked version too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarTrepodi
force-pushed
the
fix/pre-commit-all-files
branch
from
October 13, 2026 13:10
0814b2e to
f7f2b18
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.
Summary
uvx pre-commit run --all-filesfailed on develop in three hooks. This fixes each one and closes the CI gap that let them drift._comparehelpers inparity/scripts/return early when list lengths differ, sozip(..., strict=True)matches the intended semantics.tests/resources/example-player.jsonandgameData.json. These fixtures are only read throughjson.loads, so no exclusion is needed.uv run pytest tests/gives 1526 passed, 30 skipped.continue-on-error: truefrom the format step. That flag meant formatting drift could never fail CI.src/ tests/ examples/ parity/.parity/toruff check.examples/stays excluded from linting, as in the pre-commit hook. It has 28 F841/F401/I001 findings, which belong in a separate change.Notes
.on purpose. The unpinneduvx ruff(currently 0.17) also formats Markdown code blocks and would flag README.md and docs/.ci.yml(uvx ruff→uv run --no-sync ruff). To resolve it, keep ci: run ruff from uv.lock in CI and pre-commit #183's command form with this PR's paths.Test plan
uvx pre-commit run --all-filespassesuv run pytest tests/passesuvx ruff check src/ tests/ parity/anduvx ruff format --check src/ tests/ examples/ parity/pass🤖 Generated with Claude Code