.PHONY: all check format lint test test-fast bench bench-update build build-release run clean install help coverage audit deny doc-test install-hooks quorum publish-from-tag
all: format check lint test build
install-hooks:
./scripts/install-hooks.sh
quorum:
./scripts/quorum-gate.sh
check:
cargo check
format:
cargo fmt --all
lint:
cargo clippy --all-targets -- -D warnings
test:
cargo test
test-fast:
cargo test --lib
bench:
cargo bench
bench-update:
cargo run --release --bin forjar -- bench --iterations 1000 --json \
| python3 scripts/bench_update.py > benchmarks/RESULTS.md
build:
cargo build
build-release:
cargo build --release
run:
cargo run
clean:
cargo clean
install: build-release
cargo install --path .
coverage:
cargo llvm-cov --summary-only --fail-under-lines 95
.PHONY: coverage-check
coverage-check:
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ cargo llvm-cov --summary-only --fail-under-lines 95
audit:
cargo audit
cargo deny check
doc-test:
cargo test --doc
help:
@echo "forjar - Available targets:"
@echo " all - Run format, check, lint, test, and build"
@echo " check - Type check the code"
@echo " format - Format code with rustfmt"
@echo " lint - Run clippy linter"
@echo " test - Run tests"
@echo " test-fast - Run fast tests (lib only)"
@echo " bench - Run benchmarks"
@echo " bench-update - Run benchmarks and update benchmarks/RESULTS.md"
@echo " build - Build debug binary"
@echo " build-release - Build optimized release binary"
@echo " run - Run the application"
@echo " clean - Remove build artifacts"
@echo " install - Install the binary"
@echo " coverage - Run coverage analysis (95% minimum)"
@echo " coverage-check - Enforce the 95% floor (pre-release gate)"
@echo " audit - Run security audit (cargo-audit + cargo-deny)"
@echo " doc-test - Run documentation tests"
@echo " dogfood - The standing gates B C D G (hermetic; run on every commit)"
@echo " dogfood-release - dogfood plus A E (a receipt per merged PR), F (coverage + in-diff mutants) and H (crux); the pre-publish gate"
@echo " dogfood-published VERSION=x.y.z - gates C and D against the crate crates.io serves"
@echo " release-check - Tag, GitHub release, crates.io, docs.rs, quorum receipts, crux doc"
@echo " help - Show this help message"
.PHONY: dogfood dogfood-release dogfood-published release-check
dogfood:
bash scripts/dogfood/comply.sh
bash scripts/dogfood/surface.sh
bash scripts/dogfood/docs.sh
bash scripts/dogfood/contracts.sh
dogfood-release: dogfood
bash scripts/dogfood/harness.sh
bash scripts/dogfood/quorum.sh
bash scripts/dogfood/coverage.sh
bash scripts/dogfood/crux-reconcile.sh
dogfood-published:
@ @ @ test -n "$(VERSION)"
rm -rf /tmp/forjar-scratch
cargo install forjar --version $(VERSION) --locked --root /tmp/forjar-scratch
FORJAR_DOGFOOD_BIN=/tmp/forjar-scratch/bin/forjar bash scripts/dogfood/surface.sh
FORJAR_DOGFOOD_BIN=/tmp/forjar-scratch/bin/forjar bash scripts/dogfood/docs.sh
release-check:
bash scripts/dogfood/release-check.sh
.PHONY: publish-from-tag
publish-from-tag:
@test -n "$(TAG)" || { echo "usage: make publish-from-tag TAG=vX.Y.Z"; exit 2; }
DRY_RUN=$(DRY_RUN) bash scripts/publish-from-tag.sh "$(TAG)"
.PHONY: cb200-ratchet
cb200-ratchet:
@ @ @ @ @ @bash scripts/cb200-ratchet.sh