Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (60 loc) · 1.64 KB
/
Copy pathMakefile
File metadata and controls
71 lines (60 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.PHONY: help install dev test lint format fix typecheck clean check coverage
# Default target
help:
@echo "servlo — Development Commands"
@echo ""
@echo "Setup:"
@echo " make install Install all dependencies (production + dev)"
@echo ""
@echo "Quality:"
@echo " make test Run tests"
@echo " make coverage Run tests with coverage report"
@echo " make lint Run linter (ruff)"
@echo " make format Format code (ruff)"
@echo " make fix Format code with unsafe fixes"
@echo " make typecheck Run type checker (mypy)"
@echo " make check Run all checks (lint + typecheck + test)"
@echo ""
@echo "Cleanup:"
@echo " make clean Remove build artifacts"
# Install all dependencies
install:
uv venv
uv pip install -e ".[dev]"
# Alias for install
dev: install
# Run tests
test:
uv run python -m pytest tests/ -v
# Run tests with coverage
coverage:
uv run python -m pytest tests/ -v --cov=src/servlo --cov-report=html --cov-report=term
# Run linter
lint:
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
# Format code
format:
uv run ruff check --fix src/ tests/
uv run ruff format src/ tests/
# Format code with unsafe fixes
fix:
uv run ruff check --fix --unsafe-fixes src/ tests/
uv run ruff format src/ tests/
# Run type checker
typecheck:
uv run mypy src/
# Run all checks
check: lint typecheck test
# Clean build artifacts
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
rm -rf htmlcov/
rm -rf .coverage
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete