56 lines
2.5 KiB
Makefile
56 lines
2.5 KiB
Makefile
.PHONY: help install lint lint-python lint-sql format test build up down logs clean
|
|
|
|
help: ## Show this help message
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
|
|
|
|
# ── Setup ────────────────────────────────────────────────────────────────────
|
|
|
|
install: ## Install backend dependencies (including dev)
|
|
cd backend && uv sync
|
|
|
|
# ── Linting ──────────────────────────────────────────────────────────────────
|
|
|
|
lint: lint-python lint-sql ## Run all linters
|
|
|
|
lint-python: ## Lint Python code with ruff
|
|
cd backend && uv run ruff check .
|
|
cd backend && uv run ruff format --check .
|
|
|
|
lint-sql: ## Lint SQL files with sqlfluff
|
|
cd backend && uv run sqlfluff lint app/sql/
|
|
|
|
format: ## Auto-format Python and SQL code
|
|
cd backend && uv run ruff format .
|
|
cd backend && uv run ruff check --fix .
|
|
cd backend && uv run sqlfluff fix app/sql/
|
|
|
|
# ── Testing ──────────────────────────────────────────────────────────────────
|
|
|
|
test: ## Run backend unit tests
|
|
cd backend && uv run pytest -v
|
|
|
|
test-cov: ## Run tests with coverage report
|
|
cd backend && uv run pytest --cov=app --cov-report=term-missing
|
|
|
|
# ── Docker ───────────────────────────────────────────────────────────────────
|
|
|
|
build: ## Build Docker images
|
|
docker compose build
|
|
|
|
up: ## Start all services
|
|
docker compose up -d
|
|
|
|
down: ## Stop all services
|
|
docker compose down
|
|
|
|
logs: ## Tail service logs
|
|
docker compose logs -f
|
|
|
|
# ── Cleanup ──────────────────────────────────────────────────────────────────
|
|
|
|
clean: ## Remove build artifacts and caches
|
|
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
|
|
find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
|
|
find . -type d -name .ruff_cache -exec rm -rf {} + 2>/dev/null || true
|
|
rm -rf backend/.mypy_cache frontend/dist
|