-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.91 KB
/
Copy pathMakefile
File metadata and controls
58 lines (46 loc) · 1.91 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
# ============================================================================
# Bundlebench — Task Bundle CLI. Single entrypoint for the common workflows.
# Run `make` or `make help` for the catalogue.
# `make check` = the full quality gate (lint + types + import architecture + tests).
# ============================================================================
UV := uv
.DEFAULT_GOAL := help
.PHONY: help
help: ## Show this help
@awk 'BEGIN {FS = ":.*## "; print "Bundlebench — make targets\n"} \
/^# ===/ {next} \
/^[a-zA-Z0-9_-]+:.*## / {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
# ==================================================================== setup
.PHONY: install
install: ## Sync all deps (extras + dev) and install the pre-commit hooks
$(UV) sync --all-extras
$(UV) run pre-commit install
# ==================================================================== quality gate
.PHONY: lint
lint: ## Ruff lint
$(UV) run ruff check .
.PHONY: format
format: ## Ruff auto-fix + format
$(UV) run ruff check --fix . && $(UV) run ruff format .
.PHONY: type
type: ## Mypy (strict, with the pydantic plugin)
$(UV) run mypy
.PHONY: imports
imports: ## import-linter — enforce the dependency DAG
$(UV) run lint-imports
.PHONY: test
test: ## Run the test suite
$(UV) run pytest
.PHONY: cov
cov: ## Tests with coverage (enforces the fail_under ratchet)
$(UV) run pytest --cov --cov-report=term-missing
.PHONY: check
check: lint type imports test ## Full gate: lint + type + import architecture + tests
.PHONY: hooks
hooks: ## Run every pre-commit hook across all files
$(UV) run pre-commit run --all-files
# ==================================================================== housekeeping
.PHONY: clean
clean: ## Remove caches and build artefacts (keeps runs/ and the DB)
rm -rf .pytest_cache .mypy_cache .ruff_cache dist build *.egg-info
find . -type d -name __pycache__ -prune -exec rm -rf {} +