-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (64 loc) · 3.17 KB
/
Copy pathMakefile
File metadata and controls
95 lines (64 loc) · 3.17 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
# Narra — Narrative intelligence engine
# CLI + MCP server
BINARY := narra
RELEASE := target/release/$(BINARY)
DEBUG := target/debug/$(BINARY)
TEST_DATA := /tmp/narra-test-data
.PHONY: help build release check test test-unit test-integration test-snapshot \
clippy fmt fmt-check lint clean doc install size \
quick-check test-embedding test-full machete pre-release install-hooks \
check-ci
## —— General ——————————————————————————————————————————
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
## —— Build ————————————————————————————————————————————
build: ## Build debug binary
cargo build
release: ## Build optimised release binary
cargo build --release
check: ## Type-check without building
cargo check
## —— Quality ——————————————————————————————————————————
test: ## Run all tests (unit + integration)
cargo test
test-unit: ## Run unit tests only
cargo test --lib
test-integration: ## Run integration tests only
cargo test --test '*'
test-snapshot: ## Update insta snapshots then review
cargo insta test --review
clippy: ## Run clippy lints
cargo clippy -- -D warnings
fmt: ## Format code
cargo fmt
fmt-check: ## Check formatting (CI-friendly)
cargo fmt -- --check
lint: clippy fmt-check ## Run all lints (clippy + format check)
quick-check: fmt-check clippy ## Fast local check (pre-commit hook)
test-embedding: ## Run embedding model tests (ignored by default)
cargo test -- --ignored
test-full: test test-embedding ## Full test suite including embedding tests
machete: ## Check for unused dependencies
cargo machete
check-ci: ## Simulate CI locally (no Metal, catches cfg-gated dead code)
cargo fmt -- --check
cargo clippy --no-default-features --tests -- -D warnings
cargo test --no-default-features
pre-release: fmt clippy test-full machete check-ci release ## Full validation before tagging a release
## —— Docs —————————————————————————————————————————————
doc: ## Build and open rustdoc
cargo doc --open --no-deps
## —— Install / Deploy —————————————————————————————————
install: release ## Build release and confirm binary is ready
@test -f $(RELEASE) && echo "$(RELEASE) ready ($(shell du -h $(RELEASE) | cut -f1))" || (echo "Build failed"; exit 1)
## —— Utilities ————————————————————————————————————————
size: release ## Show release binary size
@du -h $(RELEASE)
clean: ## Remove build artifacts and test data
cargo clean
rm -rf $(TEST_DATA)
install-hooks: ## Install git pre-commit hook
cp scripts/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
@echo "Pre-commit hook installed."