#!/usr/bin/env bash
# scripts/hooks/pre-push — run tests before every git push
#
# Installed automatically by scripts/release.sh, or manually:
#   git config core.hooksPath scripts/hooks
#
# Skip with: git push --no-verify (emergency only)

set -euo pipefail
cd "$(git rev-parse --show-toplevel)"

echo "→ Running tests before push..."
if ! uv run pytest tests/ -x -q --tb=short; then
  echo ""
  echo "✗ Tests failed — push aborted. Fix failures or use --no-verify to skip."
  exit 1
fi
echo "✓ Tests pass — proceeding with push."
