.PHONY: install lint typecheck test test-unit test-integration build clean help

help:  ## Show this help
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

install:  ## Install package with dev extras
	pip install -e ".[dev]"

lint:  ## Run ruff linter and formatter check
	ruff check src/ tests/
	ruff format --check src/ tests/

format:  ## Auto-fix formatting and lint issues
	ruff check --fix src/ tests/
	ruff format src/ tests/

typecheck:  ## Run mypy type checker
	mypy src/

test:  ## Run all tests
	pytest tests/ -q

test-unit:  ## Run unit tests only (fast, no external deps)
	pytest tests/unit/ -q

test-integration:  ## Run integration tests (requires dev extras)
	pytest tests/integration/ -q

test-regen:  ## Regenerate regression snapshots
	pytest tests/integration/ --force-regen -q

build:  ## Build distribution packages
	pip install build && python -m build

clean:  ## Remove build artifacts and caches
	rm -rf build/ dist/ *.egg-info/ .pytest_cache/ .mypy_cache/ __pycache__/
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
