Add pre-commit hooks + enforce formatting in CI - #3
Merged
Conversation
Add .pre-commit-config.yaml (ruff lint + ruff-format, plus trailing whitespace / EOF / YAML / TOML / merge-conflict / large-file hygiene) so issues are caught before they reach CI. Revs pinned via autoupdate. - CI: add `ruff format --check` alongside the existing lint step so the same standard is enforced server-side - deps: add pre-commit to the dev extra - Makefile: add `make hooks` (pre-commit install) - README: document the code-quality workflow - apply ruff format across the codebase (whitespace-only reformat) ruff check, ruff format --check, and the 64-test suite all pass locally (ruff 0.15.21, matching the pinned hook). Co-Authored-By: Claude Opus 4.8 <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.
Summary
Adds git pre-commit hooks so lint/format/hygiene issues are caught locally before they reach CI, and enforces the same formatting standard server-side.
Changes
.pre-commit-config.yaml— ruff lint (--fix) + ruff-format, plus pre-commit-hooks hygiene (trailing whitespace, end-of-file, check-yaml, check-toml, merge-conflict, large-file, case-conflict). Revs pinned viapre-commit autoupdate.ruff format --checkstep next to the existing lint step, so formatting is enforced on every push/PR.pre-commitadded to the[dev]extra.make hooksrunspre-commit install.ruff formatacross the codebase (whitespace-only reformat, no behavioural change).Usage
Verification (local, ruff 0.15.21 — matches the pinned hook)
pre-commit run --all-files→ all hooks pass on a clean second passruff check src tests→ cleanruff format --check src tests→ 71 files already formattedpytest -q→ 64 passed🤖 Generated with Claude Code