#!/bin/bash
# Taskiq-Flow Pre-Commit Hook (Unix/WSL)

echo "========================================"
echo "Taskiq-Flow Pre-Commit Hook"
echo "========================================"
echo ""

# Skip if requested
if [ "$SKIP_PRE_COMMIT" = "1" ]; then
    echo "⚠️  Pre-commit hook skipped (SKIP_PRE_COMMIT=1)"
    exit 0
fi

echo "[1/3] Checking version synchronization..."
python scripts/version_updater.py --check
if [ $? -ne 0 ]; then
    echo "❌ Version check failed. Fix version mismatches before committing."
    echo "💡 Run: python scripts/version_updater.py --bump patch"
    exit 1
fi

echo ""
echo "[2/3] Version is consistent."

# TODO: Add other pre-commit checks (black, isort, ruff, mypy, pytest)

echo ""
echo "[3/3] All pre-commit checks passed ✅"
exit 0
