# Makefile

.PHONY: install dev test lint scan clean help

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

install: ## Install package
    pip install -e .

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

test: ## Run tests
    pytest tests/ -v --cov=ai_code_review_agent

lint: ## Lint
    ruff check src/ tests/

scan: ## Self-scan
    ai-review scan --path . --no-ai

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

docker: ## Build docker image
    docker build -f docker/Dockerfile -t ai-code-review-agent .