.PHONY: help install lint format typecheck test check clean dev

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

install: ## Create venv and install dependencies
	python3.12 -m venv .venv
	.venv/bin/pip install -e ".[dev]"

lint: ## Run linter (ruff check + format check)
	ruff check .
	ruff format --check .

format: ## Auto-format code
	ruff check --fix .
	ruff format .

typecheck: ## Run mypy type checker
	mypy src/

test: ## Run test suite with coverage
	pytest --cov=src/inedge_mcp tests/

check: lint typecheck test ## Run lint + typecheck + test (pre-push gate)

clean: ## Remove caches and build artifacts
	rm -rf .venv __pycache__ .pytest_cache .mypy_cache .ruff_cache dist build *.egg-info src/*.egg-info .coverage htmlcov

dev: ## Start MCP server in dev mode
	python -m inedge_mcp
