#!/bin/sh # # Pre-commit hook installed by huskies. # Runs script/check (fmt-check, clippy, cargo check, source-map-check) # before every commit. Aborts if any gate fails. # # Emergency bypass: git commit --no-verify (see AGENT.md — avoid this) REPO_ROOT="$(git rev-parse --show-toplevel)" printf '[pre-commit] Running script/check ...\n' OUTPUT=$("$REPO_ROOT/script/check" 2>&1) STATUS=$? if [ "$STATUS" -ne 0 ]; then printf '\n=== PRE-COMMIT HOOK FAILED ===\n\n' printf '%s\n' "$OUTPUT" printf '\nFix the issues above, then re-validate with:\n' printf ' script/check\n' printf '\nEmergency bypass (see AGENT.md -- avoid this):\n' printf ' git commit --no-verify\n\n' exit 1 fi