mirror of
https://github.com/ratspeak/C6-Reticulum-ASM
synced 2026-08-12 18:07:18 -04:00
26 lines
936 B
Bash
Executable file
26 lines
936 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Pre-commit guard: run `make ci` (registry + stack + tests) and block the
|
|
# commit on failure. Per milestone-1 §Definition of done, every commit must
|
|
# pass `make ci`. This file is the local-repo equivalent of the
|
|
# .github/workflows/ runner the DoD also accepts.
|
|
#
|
|
# Install once:
|
|
# ln -sf ../../tools/git-hooks/pre-commit .git/hooks/pre-commit
|
|
# (relative symlink so the hook follows toolchain updates without re-installing.)
|
|
#
|
|
# Bypass deliberately (e.g., emergency WIP push to a branch you will rewrite):
|
|
# git commit --no-verify
|
|
# CLAUDE.md forbids bypassing hooks for AI agents — humans only, with a reason.
|
|
|
|
set -euo pipefail
|
|
|
|
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
cd "$REPO_ROOT"
|
|
|
|
echo "pre-commit: running make ci"
|
|
if ! make ci; then
|
|
echo
|
|
echo "pre-commit: 'make ci' failed — commit blocked." >&2
|
|
echo "Fix the failing checks, re-stage, and commit again." >&2
|
|
exit 1
|
|
fi
|