guide / scripts /hooks /pre-commit
anmol-iisc's picture
UI improvements + specs.md update
0d8c22c
Raw
History Blame Contribute Delete
748 Bytes
#!/usr/bin/env bash
# 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."