chore(lint): pre-push hook for full-tree paddy-format + ruff#762
Conversation
CI's Python / Lint job runs `ruff check` + `paddy_format.py --check` over the entire `buckaroo/ tests/ scripts/` tree, but the local `paddy-format` pre-commit hook only sees staged files. Drift introduced by a recent merge to main (e.g. an unrelated PR that didn't run the formatter) only surfaces on CI for the next person to push, even if their own staged files are clean — exactly what happened to PR #761. Add a pre-push stage that mirrors CI's lint job, so the same full-tree check runs locally before push: - ruff-check-full: `uv run ruff check` (no file filter) - paddy-format-check-full: `--check` over the same find expression CI uses To activate locally, run `pre-commit install --hook-type pre-push` once (or `pre-commit install --install-hooks --hook-type pre-commit --hook-type pre-push`). Also reformat `tests/unit/dataflow/autocleaning_pl_test.py` which was the file CI flagged on #761. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ea4dc855e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # so drift in a file you didn't touch (e.g. introduced by a recent | ||
| # merge to main) slips through and only surfaces on CI. Mirrors | ||
| # the `LintPython` job in .github/workflows/checks.yml. | ||
| - id: ruff-check-full |
There was a problem hiding this comment.
Restrict the existing hooks to pre-commit
With these new pre-push hooks, the activation command in the commit message (pre-commit install --hook-type pre-push) will also run every hook that has no explicit stages, because the pre-commit docs define stages as defaulting to all stages. That means the existing paddy-format hook above will run during git push as a mutating formatter rather than as --check, so pushing commits that contain format drift can rewrite the working tree and abort the push instead of only running the two intended CI-mirroring gates. Add stages: [pre-commit] (or a top-level default_stages: [pre-commit] plus overrides) for the existing commit-time hooks.
Useful? React with 👍 / 👎.
📦 TestPyPI package publishedpip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.14.0.dev25998433830or with uv: uv pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.14.0.dev25998433830MCP server for Claude Codeclaude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.14.0.dev25998433830" --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo-table📖 Docs preview🎨 Storybook preview |
Summary
PR #761 failed
Python / Linton a file I never touched — drift introduced by a recent merge to main (#758) wasn't caught locally because the existingpaddy-formatpre-commit hook only sees staged files, while CI'sLintPythonjob runs--checkover the entirebuckaroo/ tests/ scripts/tree.This adds a pre-push stage that mirrors CI's lint job: re-run
ruff checkandpaddy_format.py --checkover the full tree before push. Drift in a file you didn't touch now blocksgit pushinstead of showing up red in CI an hour later.Also reformats the file CI flagged (
tests/unit/dataflow/autocleaning_pl_test.py) so #761 unblocks once this merges + #761 rebases onto main.Activating locally
(Or
pre-commit install --install-hooks --hook-type pre-commit --hook-type pre-pushto install both.)Test plan
pre-commit run --all-files --hook-stage pre-push— both new hooks passgit pushtriggers the hooks (verified by this branch's push)Python / Lintpasses