.PHONY: test lint format typecheck check build release

test:
	uv run pytest

lint:
	uv run ruff check src/ tests/

format:
	uv run ruff format src/ tests/

typecheck:
	uv run mypy src/

# Run all checks (same as CI)
check: lint typecheck test

build:
	uv build

# Usage: make release v=0.2.0
release:
	@if [ -z "$(v)" ]; then echo "Usage: make release v=X.Y.Z"; exit 1; fi
	@echo "Releasing v$(v)..."
	sed -i '' 's/^version = ".*"/version = "$(v)"/' pyproject.toml
	git add pyproject.toml
	git commit -m "release v$(v)"
	git tag "v$(v)"
	git push origin main "v$(v)"
	gh release create "v$(v)" --generate-notes
	@echo "Done! GitHub Actions will publish to PyPI."
