#!/bin/sh
# pre-push hook: runs unit tests before every git push
# To bypass: git push --no-verify

echo "🧪 Running unit tests..."

uv run pytest tests/unit/ -q
exit_code=$?

if [ $exit_code -ne 0 ]; then
    echo ""
    echo "❌ Unit tests failed. Push aborted."
    echo "   To bypass: git push --no-verify"
    exit 1
fi

echo "✅ All unit tests passed."
exit 0
