Skip to content

chore(lint): pre-push hook for full-tree paddy-format + ruff#762

Merged
paddymul merged 1 commit into
mainfrom
chore/lint-prevention
May 17, 2026
Merged

chore(lint): pre-push hook for full-tree paddy-format + ruff#762
paddymul merged 1 commit into
mainfrom
chore/lint-prevention

Conversation

@paddymul
Copy link
Copy Markdown
Collaborator

Summary

PR #761 failed Python / Lint on a file I never touched — drift introduced by a recent merge to main (#758) wasn't caught locally because the existing paddy-format pre-commit hook only sees staged files, while CI's LintPython job runs --check over the entire buckaroo/ tests/ scripts/ tree.

This adds a pre-push stage that mirrors CI's lint job: re-run ruff check and paddy_format.py --check over the full tree before push. Drift in a file you didn't touch now blocks git push instead 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

pre-commit install --hook-type pre-push

(Or pre-commit install --install-hooks --hook-type pre-commit --hook-type pre-push to install both.)

Test plan

  • pre-commit run --all-files --hook-stage pre-push — both new hooks pass
  • git push triggers the hooks (verified by this branch's push)
  • CI's Python / Lint passes

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>
@paddymul paddymul merged commit ff46e55 into main May 17, 2026
16 of 17 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .pre-commit-config.yaml
# 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

📦 TestPyPI package published

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.dev25998433830

or 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.dev25998433830

MCP server for Claude Code

claude 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

paddymul added a commit that referenced this pull request May 17, 2026
The three new tests in #763 wrote nested dicts with hanging indents
under the opening brace; paddy_format wants the standard 4-space
continuation. CI Lint job caught it via the full-tree paddy_format
check that #762 added.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant