.PHONY: help install test cov build clean docs-install docs-serve docs-build

help:
	@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

install: ## Install dev dependencies
	uv pip install -e ".[dev]"

test: ## Run tests
	uv run pytest

cov: ## Run tests with coverage
	uv run pytest --cov=tortoise_passkey --cov-report=term-missing

build: ## Build distribution
	uv build

clean: ## Remove build artifacts and caches
	rm -rf build dist *.egg-info .pytest_cache .mypy_cache .ruff_cache htmlcov .coverage site
	find . -type d -name __pycache__ -exec rm -rf {} +

docs-install: ## Install documentation dependencies
	uv pip install -e ".[docs]"

docs-serve: ## Serve the documentation locally with live reload
	uv run mkdocs serve

docs-build: ## Build the static documentation site into ./site
	uv run mkdocs build --strict
