-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (55 loc) · 2.22 KB
/
Makefile
File metadata and controls
74 lines (55 loc) · 2.22 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
.PHONY: help install format lint lint-fix typecheck docstring style fix \
check sync clean test stats watch
.DEFAULT_GOAL := help
TEST_FLAGS := -xvv -s
install: ## Create / update virtual‑env with all dependency groups
uv sync --all-groups
format: ## Format code using ruff
uv run ruff format .
lint: ## Run linting using ruff
uv run ruff check .
lint-fix: ## Run linting with automatic fixes
uv run ruff check --fix .
typecheck: ## Run static type checking
uv run pyright
docstring: ## Check docstring style and completeness
uv run ruff check . --select D,PD
style: ## Check code style (without docstrings)
uv run ruff check . --select E,W,F,I,N,UP,B,C4,SIM,TCH
fix: format lint-fix ## Run all formatters and fixers
check: fix typecheck ## Run all checks (format, lint‑fix, typecheck)
sync: ## Re‑lock and install latest versions
uv lock --upgrade
uv sync --all-groups --reinstall
clean: ## Remove build artefacts and caches
rm -rf .ruff_cache/ .mypy_cache/ .pytest_cache/ dist/ build/
find . -type d -name __pycache__ -exec rm -rf {} +
test: ## Run tests
uv run pytest $(TEST_FLAGS)
stats: ## Show code quality statistics
@echo "=== Docstring Coverage ==="
@uv run ruff check . --select D --statistics
@echo "\n=== Missing Type Hints ==="
@uv run ruff check . --select ANN --statistics
@echo "\n=== Style Issues ==="
@uv run ruff check . --select E,W,F,I,N --statistics
# Watch tests, optionally limited to a path:
# make watch → watch entire suite
# make watch path/to/file → watch single test file
watch:
@if [ -z "$(filter-out $@,$(MAKECMDGOALS))" ]; then \
uv run pytest-watcher . -- tests $(TEST_FLAGS) -W ignore::DeprecationWarning; \
else \
path_arg="$(filter-out $@,$(MAKECMDGOALS))"; \
uv run pytest-watcher . -- tests/$$path_arg $(TEST_FLAGS) -W ignore::DeprecationWarning; \
fi
# Pattern rule so additional args do not trigger "No rule to make target"
%:
@:
# Project‑specific entry points (replace poetry run → uv run)
help: ## Display this help message
@echo 'Usage:'
@echo ' make <target>'
@echo ''
@echo 'Targets:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'