#!/bin/sh
# mkd check gate: formatting, lint and tests must pass before every commit.
# Enable once per clone with: git config core.hooksPath .githooks
set -eu

echo "pre-commit: checking formatting"
cargo fmt --all -- --check

# --locked: the gate vouches for the committed lockfile's resolution,
# never a silently regenerated one (verifiable dependency provenance).
echo "pre-commit: running clippy"
cargo clippy --locked --all-targets --all-features -- -D warnings

echo "pre-commit: running tests"
cargo test --locked --all-features

echo "pre-commit: check gate passed"
