.PHONY: help init install-dev fmt lint lint-fix type-check check clean

# Default target
help: ## Show this help message
	@echo "Available commands:"
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "  %-15s %s\n", $$1, $$2}'

init: ## Initialize UV environment and install dependencies
	uv venv
	uv pip install -e ".[dev]"

install-dev: ## Install the package with development dependencies
	uv pip install -e ".[dev]"

fmt: ## Format code with ruff
	ruff format .

lint: ## Lint code with ruff
	ruff check .

lint-fix: ## Lint and fix code with ruff
	ruff check --fix .

type-check: ## Run type checking with mypy
	mypy src/

check: lint type-check ## Run all checks (lint and type-check)

clean: ## Clean build artifacts and cache
	rm -rf build/
	rm -rf dist/
	rm -rf *.egg-info/
	find . -type f -name "*.pyc" -delete
	find . -type d -name "__pycache__" -delete
	rm -rf .venv
	rm -rf .mypy_cache
	rm -rf .ruff_cache
