if ! git diff --cached --name-only | grep -q '\.rs$'; then
exit 0
fi
repo_root="$(git rev-parse --show-toplevel)"
"$repo_root/scripts/check.sh" || {
echo ""
echo "❌ pre-commit checks failed."
echo " Run \`scripts/check.sh --fix\` to auto-format, then re-stage and commit."
exit 1
}