-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (73 loc) · 2.33 KB
/
Copy pathMakefile
File metadata and controls
96 lines (73 loc) · 2.33 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
.PHONY: help install lint lint-fix format format-check typecheck securite arch check test test-watch benchmark ci mutation commit bump changelog docker-build docker-up docker-down clean
## Show this help
help:
@grep -E '^## ' Makefile | sed 's/## / /'
## Install dependencies and git hooks
install:
uv sync --extra dev
uv run pre-commit install
## Run lint (ruff)
lint:
uv run ruff check src tests
## Auto-fix lint errors
lint-fix:
uv run ruff check --fix src tests
## Format code (ruff format)
format:
uv run ruff format src tests
## Check formatting without modifying files
format-check:
uv run ruff format --check src tests
## Check types (mypy strict)
typecheck:
uv run mypy src
## Static security analysis (bandit) + dependency vulnerabilities (pip-audit)
securite:
uv run bandit -c pyproject.toml -r src
uv run pip-audit
## Cyclomatic complexity check (xenon) — fails if average > A or any function > C
complexity:
uv run xenon --max-average=A --max-modules=B --max-absolute=C src
## Check architecture import boundaries (tach)
arch:
uv run tach check
## Lint + format + types + security + complexity + architecture (mirrors CI locally)
check: lint format-check typecheck securite complexity arch
## Run tests with coverage report (threshold: 80%)
test:
uv run pytest
## Run tests in watch mode
test-watch:
uv run pytest-watch
## Performance benchmarks on the domain (excluded from normal run)
benchmark:
uv run pytest tests/examples/test_benchmarks.py --benchmark-only --benchmark-sort=mean
## Run the full CI pipeline locally, in order
ci: check test
@echo "CI pipeline completed successfully."
## Mutation testing on the domain slice only (slow — reserve for PRs)
mutation:
uv run mutmut run
uv run mutmut results
## Interactive conventional commit (commitizen)
commit:
uv run cz commit
## Bump version + update CHANGELOG.md (commitizen)
bump:
uv run cz bump
## Regenerate CHANGELOG.md from commit history
changelog:
uv run cz changelog
## Build the Docker image
docker-build:
docker build --target runtime -t my-project .
## Start the stack (app + dependencies)
docker-up:
docker compose up --build -d
## Stop the stack
docker-down:
docker compose down
## Remove build and cache artefacts
clean:
rm -rf .pytest_cache .mypy_cache .ruff_cache __pycache__ coverage.xml htmlcov
find . -type d -name __pycache__ -exec rm -rf {} +