#!/bin/sh
# Cheapest gate first: formatting. Enable once per clone with
#   git config core.hooksPath .githooks
# Everything else (clippy, docs, tests) is tools/check-local.sh and CI.
set -e
if ! cargo fmt --all -- --check >/dev/null 2>&1; then
    echo "pre-commit: cargo fmt --all -- --check failed; run 'cargo fmt --all' and re-stage." >&2
    exit 1
fi
