forked from xsovad06/sova
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (44 loc) · 2.45 KB
/
Copy pathMakefile
File metadata and controls
64 lines (44 loc) · 2.45 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
.PHONY: serve dev test lint lint-bash lint-py format check install-deps setup help
SHELL := /bin/bash
# GNU Make 3.81 (macOS default) skips the shell for simple commands,
# bypassing exported PATH. Use full paths for pip-installed tools.
PYTHON_USER_BIN := $(shell python3 -m site --user-base)/bin
RUFF := $(PYTHON_USER_BIN)/ruff
PYTEST := $(PYTHON_USER_BIN)/pytest
# ── Main targets ──────────────────────────────────────────────
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
serve: ## Start the dashboard (http://localhost:8111)
sova dashboard
dev: ## Start the dashboard with auto-reload
sova dashboard --reload
test: test-bash test-py ## Run all tests
check: lint test ## Run linter + tests (CI-equivalent)
# ── Testing ───────────────────────────────────────────────────
test-bash: lint-bash ## Validate bash scripts (shellcheck + --help)
@echo ""
@echo "-- invariant scripts --help --"
@for f in invariants/*.sh; do \
printf " %-30s" "$$f"; \
bash "$$f" --help >/dev/null 2>&1 && echo "ok" || echo "FAIL"; \
done
test-py: ## Run pytest suite
$(PYTEST) tests/ -v
# ── Linting ───────────────────────────────────────────────────
lint: lint-bash lint-py ## Run all linters
lint-bash: ## ShellCheck on invariant scripts
shellcheck invariants/*.sh
lint-py: ## Ruff lint + format check
$(RUFF) check sova/ tests/
$(RUFF) format --check sova/ tests/
# ── Formatting ────────────────────────────────────────────────
format: ## Auto-format Python code
$(RUFF) format sova/ tests/
$(RUFF) check --fix sova/ tests/
# ── Setup ─────────────────────────────────────────────────────
setup: install-deps ## Set up development environment (deps + hooks)
git config core.hooksPath .githooks
@echo "Development environment ready. Run 'make check' to verify."
install-deps: ## Install/update all dependencies
pip install -q -e ".[dev]"