Spaces:
Sleeping
Sleeping
| # G.U.I.D.E. pre-commit gate β runs the sanity suite (SPEC.md Β§3-4). | |
| # No code may be committed while these fail. Bypass only with --no-verify. | |
| set -euo pipefail | |
| ROOT="$(git rev-parse --show-toplevel)" | |
| cd "$ROOT" | |
| if [ -x ".venv/bin/python" ]; then | |
| PY=".venv/bin/python" | |
| else | |
| PY="python3" | |
| fi | |
| echo "[pre-commit] Running G.U.I.D.E. sanity tests ($PY)β¦" | |
| if ! "$PY" -m pytest tests/test_sanity.py -q; then | |
| echo "" | |
| echo "[pre-commit] β Sanity tests failed β commit aborted (see SPEC.md)." | |
| echo "[pre-commit] Fix the failures, or bypass with 'git commit --no-verify'" | |
| echo "[pre-commit] (only in a genuine emergency; the change is then not Done)." | |
| exit 1 | |
| fi | |
| echo "[pre-commit] β Sanity tests passed." | |