16 lines
864 B
Plaintext
16 lines
864 B
Plaintext
---
|
|
description: Require make test before git commit; never bypass pre-commit without explicit user request
|
|
alwaysApply: true
|
|
---
|
|
|
|
# Git commit gate
|
|
|
|
Before **`git commit`** (including when the user asks the agent to commit):
|
|
|
|
1. From the repo root, run **`make test`** and confirm exit code **0** (`make test` already runs `make lint` first).
|
|
2. Only then stage and commit. Do **not** commit while tests are failing or were not run for this change set.
|
|
3. Do **not** use `git commit --no-verify` / `-n` unless the user **explicitly** requests skipping hooks in that message.
|
|
4. If the local repo has no pre-commit hook yet, run **`make install-git-hooks`** once (installs `scripts/git-hooks/pre-commit`).
|
|
|
|
Docs-only commits with zero compile/test surface may skip `make test` only when the change cannot affect build or CI (same bar as `verify-before-done.mdc`).
|