.PHONY: help build test test-fast coverage lint fmt clean all quality-gates
help:
@echo 'Trueno Development Commands:'
@echo ''
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
build:
cargo build --all-features
build-release:
cargo build --release --all-features
test:
cargo test --all-features -- --nocapture
test-fast:
@echo "⏱️ Running fast test suite (target: <5 min)..."
@time cargo test --all-features --quiet
test-verbose:
cargo test --all-features -- --nocapture --test-threads=1
coverage:
@echo "📊 Generating coverage report (target: >85%, <10 min)..."
@ @test -f ~/.cargo/config.toml && mv ~/.cargo/config.toml ~/.cargo/config.toml.cov-backup || true
@cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
@cargo llvm-cov report --html --output-dir target/coverage/html
@ @test -f ~/.cargo/config.toml.cov-backup && mv ~/.cargo/config.toml.cov-backup ~/.cargo/config.toml || true
@echo "✅ Coverage report: target/coverage/html/index.html"
@cargo llvm-cov report | grep TOTAL
lint:
@echo "🔍 Running clippy (zero warnings policy)..."
cargo clippy --all-targets --all-features -- -D warnings
fmt:
cargo fmt
fmt-check:
cargo fmt -- --check
bench:
cargo bench --no-fail-fast
mutate:
@echo "🧬 Running mutation testing (target: >80% kill rate)..."
@command -v cargo-mutants >/dev/null 2>&1 || { echo "Installing cargo-mutants..."; cargo install cargo-mutants; }
cargo mutants --timeout 60
clean:
cargo clean
rm -rf target/
rm -f lcov.info
quality-gates: lint fmt-check test-fast coverage
@echo ""
@echo "✅ All quality gates passed!"
@echo ""
@echo "Summary:"
@echo " ✅ Linting: cargo clippy (zero warnings)"
@echo " ✅ Formatting: cargo fmt"
@echo " ✅ Tests: cargo test (all passing)"
@echo " ✅ Coverage: >85% (see report above)"
@echo ""
@echo "Ready to commit!"
all: quality-gates
pmat-tdg:
pmat tdg
pmat-analyze:
pmat analyze complexity
pmat analyze satd
pmat-score:
pmat repo-score .
dev:
cargo watch -x 'test --all-features'
install-tools:
cargo install cargo-llvm-cov
cargo install cargo-watch
cargo install cargo-mutants
cargo install criterion
.DEFAULT_GOAL := help