-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (50 loc) · 3.4 KB
/
Copy pathMakefile
File metadata and controls
71 lines (50 loc) · 3.4 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 sync test test-engine test-utils test-wiki-agent lint typecheck check check-layering check-coverage build clean adr
# ─────────────────────────────────────────────────────────────
# llm-patch monorepo — workspace fan-out commands
# Per-project Makefiles live in projects/<name>/Makefile.
# ─────────────────────────────────────────────────────────────
UV := uv
help: ## Show this help message
@echo.
@echo llm-patch monorepo
@echo ──────────────────
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s %s\n", $$1, $$2}'
sync: ## Sync the entire workspace
$(UV) sync
# ── Tests ───────────────────────────────────────────────────
test-engine: ## Run engine tests
cd projects/llm-patch && $(UV) run pytest -q
test-utils: ## Run utils smoke tests
cd projects/utils && $(UV) run pytest -q
test-wiki-agent: ## Run wiki-agent smoke tests
cd projects/wiki-agent && $(UV) run pytest -q
test: test-engine test-utils test-wiki-agent ## Run tests for every workspace member
# ── Quality ─────────────────────────────────────────────────
lint: ## Lint the entire workspace
$(UV) run ruff check .
typecheck: ## Mypy strict for every project
cd projects/llm-patch && $(UV) run mypy src
cd projects/utils && $(UV) run mypy src
cd projects/wiki-agent && $(UV) run mypy src
check-layering: ## Architectural fitness check (ADR-0002)
$(UV) run python tools/check_layering.py
check-coverage: ## Enforce workspace coverage thresholds
cd projects/llm-patch && $(UV) run pytest --cov=llm_patch --cov-branch --cov-report=xml:coverage.xml -q
$(UV) run python tools/check_coverage.py projects/llm-patch/coverage.xml
check: lint typecheck check-layering test check-coverage ## Lint + typecheck + layering + tests
# ── Build ───────────────────────────────────────────────────
build: ## Build distributions for every project
cd projects/llm-patch && $(UV) build
cd projects/utils && $(UV) build
cd projects/wiki-agent && $(UV) build
# ── ADR helper ──────────────────────────────────────────────
adr: ## Scaffold a new ADR: make adr title="my-decision"
@test -n "$(title)" || (echo "Usage: make adr title=\"my-decision\""; exit 2)
@next=$$(printf '%04d' $$(($$(ls docs/adr/[0-9]*.md 2>/dev/null | wc -l) + 1))); \
cp docs/adr/0000-template.md "docs/adr/$$next-$(title).md"; \
echo "Created docs/adr/$$next-$(title).md"
# ── Cleanup ─────────────────────────────────────────────────
clean: ## Remove caches and build artifacts
rm -rf dist build .pytest_cache .pytest_tmp .mypy_cache .ruff_cache htmlcov .coverage coverage.xml
find . -type d -name __pycache__ -prune -exec rm -rf {} + 2>/dev/null || true