-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (50 loc) · 1.7 KB
/
Makefile
File metadata and controls
65 lines (50 loc) · 1.7 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
BIN := rust-code
CARGO := cargo
RELEASE := target/release/$(BIN)
.PHONY: build release test run lint check audit-deps audit-loc audit clean install help
## Build debug binary
build:
$(CARGO) build
## Build optimized release binary
release:
$(CARGO) build --release -p $(BIN)
## Run all tests (our crates + genai gemini tests)
test:
$(CARGO) test -p sgr-agent --features "agent search" -p sgr-agent-tui -p rust-code -p solograph
@echo "=== genai gemini tests ==="
$(CARGO) test -p genai --test tests_p_gemini 2>&1 || echo "(genai gemini tests skipped — no GEMINI_API_KEY?)"
## Run headless with PROMPT
run: build
$(CARGO) run -- -p "$(PROMPT)"
## Clippy lint (sgr-agent + sgr-agent-tui clean, rc-cli has legacy warnings)
lint:
$(CARGO) clippy -p sgr-agent -p sgr-agent-tui -p solograph --all-targets -- -D warnings
## Format check
fmt-check:
$(CARGO) fmt -p sgr-agent -p sgr-agent-tui -p rust-code -p solograph -- --check
## Format fix
fmt:
$(CARGO) fmt -p sgr-agent -p sgr-agent-tui -p rust-code -p solograph
## Pre-commit check (test + lint + fmt)
check: test lint fmt-check
## Audit: unused deps (requires: cargo install cargo-machete)
audit-deps:
@echo "=== Unused dependencies ==="
@cargo machete 2>&1 || true
## Audit: large files (>800 LOC)
audit-loc:
@echo "=== Files >800 LOC ==="
@tokei crates/ --types Rust --files 2>&1 | grep -E "\.rs\s+[0-9]" | awk '$$2 > 800 {print $$2, $$1}' | sort -rn || true
## Full audit
audit: audit-deps audit-loc
## Install binary
install: release
strip $(RELEASE)
cp $(RELEASE) /usr/local/bin/$(BIN)
@echo "Installed to /usr/local/bin/$(BIN)"
## Clean build artifacts
clean:
$(CARGO) clean
## Show this help
help:
@grep -E '^## ' Makefile | sed 's/## / /'