set -e
echo "Running pre-commit checks..."
echo "→ cargo fmt --check"
if ! cargo fmt --check; then
echo ""
echo "Formatting issues found. Run 'cargo fmt' to fix."
exit 1
fi
echo "→ cargo clippy -- -D warnings"
if ! cargo clippy -- -D warnings; then
echo ""
echo "Clippy found issues. Fix the warnings above."
exit 1
fi
echo "✓ All checks passed"