Skip to content

feat: run the CI checks in a pre-push hook - #84

Merged
thatsrue merged 1 commit into
mainfrom
pre-push-gate
Nov 2, 2026
Merged

thatsrue merged 1 commit into
mainfrom
pre-push-gate

Conversation

@thatsrue

Copy link
Copy Markdown
Collaborator

What changed

Adds lefthook.yml with a pre-push job that runs make lint typecheck test-fast, and a line in docs/README.md and AGENTS.md on enabling it with lefthook install. The job clears git's repo variables first, so it runs from a linked worktree.

Why

CI runs ruff, mypy and pytest -m "not slow" on every pull request. A push should not need CI to find a failure the local checks would. The package build job is not in the hook.

Closes #83

How you checked it

  • make lint typecheck test-fast from a fresh worktree of origin/main: exit 0, 7 s (296 passed)
  • lefthook run pre-push --force (lefthook 2.2.2): exit 0, 4 s. Run again with GIT_DIR and GIT_INDEX_FILE exported: exit 0, 4 s
  • A bug fix comes with a test that fails without it (not a bug fix)
  • Docs match how it works now
  • No secrets or private information

The worktree needs its own .venv, as make uses it.

@thatsrue
thatsrue merged commit baee66e into main Nov 2, 2026
4 checks passed
@thatsrue
thatsrue deleted the pre-push-gate branch November 2, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

feat: run the CI checks in a pre-push hook

1 participant