Skip to content

Run make quality before every commit with a git pre-commit hook #4206

Open

Description

@anth-volk

What

Run make quality before every commit, with a git pre-commit hook:

  • A committed .githooks/pre-commit runs make quality from the root of the working tree.
  • The commit fails when a check fails, or when ruff's fixes changed files that still need staging. The hook lists those files.
  • It also fails, with a message saying what to do, when uv or make isn't installed or the worktree has no dev environment (.venv).
  • make install turns the hook on with git config core.hooksPath .githooks. That setting is shared by every worktree of the clone, and each worktree runs its own checkout's hook.
  • AGENTS.md, the GitHub PRs skill and README.md say to run make install once per clone.
  • A registered rule with a proof checks the hook's behavior in a temporary repository.

Why

make quality (#4203) runs the same checks as pull-request CI, but only when someone remembers to run it. The hook runs it before an agent's or a person's commit, so problems show in seconds instead of after a CI run. This is tracker task 6.4 · 10, following decision 6.4 · 9: a git pre-commit hook running all of make quality, not a Claude Code hook. make quality takes about 3 seconds with warm caches and about 10 seconds cold. git commit --no-verify still skips the hook, and CI's Quality checks job remains the required check.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions