#!/bin/sh
set -e

echo "Running cargo fmt --check..."
cargo fmt -- --check || {
    echo "Format check failed. Run 'cargo fmt' to fix."
    exit 1
}

echo "Running cargo clippy..."
cargo clippy --all-targets -- -D warnings || {
    echo "Clippy check failed. Fix the warnings above."
    exit 1
}
