Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
214 lines (171 loc) · 7 KB
/
Copy pathMakefile
File metadata and controls
214 lines (171 loc) · 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Infiniloom Makefile
# Unified build, lint, test, and coverage commands
.PHONY: all build build-release clean test test-all test-python test-node lint fmt check coverage doc ci install-tools help
# Default target
all: fmt lint test build
# ============================================================================
# Build Commands
# ============================================================================
build:
cargo build --workspace
build-release:
cargo build --workspace --release
clean:
cargo clean
# ============================================================================
# Testing
# ============================================================================
test:
cargo test --workspace --all-features
test-release:
cargo test --workspace --all-features --release
test-all: test test-python test-node
test-python:
cd bindings/python && pip install maturin pytest
cd bindings/python && maturin develop --release
cd bindings/python && pytest -v
test-node:
cd b
8000
indings/node && npm install
cd bindings/node && npm run build
cd bindings/node && npm test
# ============================================================================
# Linting & Formatting
# ============================================================================
# Format code
fmt:
cargo fmt --all
# Check formatting without changing files
fmt-check:
cargo fmt --all -- --check
# Run clippy with strictest settings
lint:
cargo clippy --workspace --all-targets --all-features -- \
-D warnings \
-D clippy::all \
-D clippy::pedantic \
-D clippy::nursery \
-W clippy::cargo
# Full check (compile without codegen)
check:
cargo check --workspace --all-targets --all-features
# ============================================================================
# Code Coverage
# ============================================================================
# Install coverage tools if not present
install-coverage-tools:
@command -v cargo-llvm-cov >/dev/null 2>&1 || cargo install cargo-llvm-cov
@command -v grcov >/dev/null 2>&1 || cargo install grcov
# Generate coverage report (HTML)
coverage: install-coverage-tools
cargo llvm-cov --workspace --all-features --html --output-dir target/coverage
@echo "Coverage report generated at target/coverage/html/index.html"
# Generate coverage report (LCOV format for CI)
coverage-lcov: install-coverage-tools
cargo llvm-cov --workspace --all-features --lcov --output-path target/coverage/lcov.info
@echo "LCOV report generated at target/coverage/lcov.info"
# Generate coverage report (JSON for badges)
coverage-json: install-coverage-tools
cargo llvm-cov --workspace --all-features --json --output-path target/coverage/coverage.json
@echo "JSON report generated at target/coverage/coverage.json"
# Show coverage summary in terminal
coverage-summary: install-coverage-tools
cargo llvm-cov --workspace --all-features
# Coverage with branch coverage
coverage-branches: install-coverage-tools
CARGO_LLVM_COV_SHOW_BRANCHES=1 cargo llvm-cov --workspace --all-features --html --output-dir target/coverage-branches
@echo "Branch coverage report generated at target/coverage-branches/html/index.html"
# Clean coverage data
coverage-clean:
cargo llvm-cov clean --workspace
# ============================================================================
# Documentation
# ============================================================================
doc:
cargo doc --workspace --all-features --no-deps
@echo "Documentation generated at target/doc/"
doc-open: doc
open target/doc/infiniloom_engine/index.html 2>/dev/null || xdg-open target/doc/infiniloom_engine/index.html
# ============================================================================
# CI Pipeline
# ============================================================================
ci: fmt-check lint test coverage-lcov
@echo "CI pipeline completed successfully"
# Pre-commit checks (fast)
pre-commit: fmt-check check lint
@echo "Pre-commit checks passed"
# ============================================================================
# Security Audit
# ============================================================================
audit:
@command -v cargo-audit >/dev/null 2>&1 || cargo install cargo-audit
cargo audit
# ============================================================================
# Benchmarks
# ============================================================================
bench:
cargo bench --workspace
# ============================================================================
# Tool Installation
# ============================================================================
install-tools:
@echo "Installing development tools..."
rustup component add rustfmt clippy llvm-tools-preview
cargo install cargo-llvm-cov cargo-audit cargo-deny cargo-outdated cargo-machete
@echo "All tools installed successfully"
# Check for outdated dependencies
outdated:
@command -v cargo-outdated >/dev/null 2>&1 || cargo install cargo-outdated
cargo outdated --workspace
# Find unused dependencies
unused-deps:
@command -v cargo-machete >/dev/null 2>&1 || cargo install cargo-machete
cargo machete
# ============================================================================
# Release
# ============================================================================
release-check:
cargo publish --dry-run -p infiniloom-engine
cargo publish --dry-run -p infiniloom
# ============================================================================
# Help
# ============================================================================
help:
@echo "Infiniloom Development Commands"
@echo "==============================="
@echo ""
@echo "Build:"
@echo " make build - Build debug version"
@echo " make build-release - Build release version"
@echo " make clean - Clean all build artifacts"
@echo ""
@echo "Testing:"
@echo " make test - Run all tests"
@echo " make test-release - Run tests in release mode"
@echo " make test-all - Run Rust + Python + Node tests"
@echo ""
@echo "Code Quality:"
@echo " make fmt - Format all code"
@echo " make fmt-check - Check formatting"
@echo " make lint - Run clippy lints"
@echo " make check - Quick compile check"
@echo ""
@echo "Coverage:"
@echo " make coverage - Generate HTML coverage report"
@echo " make coverage-lcov - Generate LCOV report (for CI)"
@echo " make coverage-json - Generate JSON report"
@echo " make coverage-summary - Show coverage in terminal"
@echo ""
@echo "CI/CD:"
@echo " make ci - Run full CI pipeline"
@echo " make pre-commit - Run pre-commit checks"
@echo " make audit - Security audit"
@echo ""
@echo "Documentation:"
@echo " make doc - Generate documentation"
@echo " make doc-open - Generate and open docs"
@echo ""
@echo "Utilities:"
@echo " make install-tools - Install all dev tools"
@echo " make outdated - Check for outdated deps"
@echo " make unused-deps - Find unused dependencies"
@echo " make help - Show this help"