.DEFAULT_GOAL := help
SHELL := /usr/bin/env bash
help:
@grep -hE '^[a-z-]+:.*?## ' $(MAKEFILE_LIST) \
| awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
lint:
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
@if command -v shellcheck > /dev/null; then \
shellcheck verify.sh tests/*.sh; \
else \
echo " (shellcheck not installed — skipped)"; \
fi
test:
cargo test
conformance:
cargo build --release
@echo "--- verify.sh ---"
@./tests/conformance.sh "bash $(PWD)/verify.sh --quiet"
@echo "--- git-attest ---"
@./tests/conformance.sh "$(PWD)/target/release/git-attest covered"
@echo "--- legacy.sh (negative control: MUST fail) ---"
@if SKIP_JSON=1 ./tests/conformance.sh "bash $(PWD)/tests/legacy.sh" > /dev/null 2>&1; then \
echo " ✗ legacy.sh PASSED the suite — the fixtures no longer prove anything"; \
exit 1; \
else \
echo " ok legacy.sh still fails the defects it shipped with"; \
fi
check: lint test conformance
fmt:
cargo fmt --all
msrv:
@v=$$(awk -F'"' '/^rust-version/ {print $$2}' Cargo.toml); \
echo "checking MSRV $$v"; \
rustup toolchain install "$$v" --profile minimal 2> /dev/null || true; \
cargo "+$$v" check --locked
.PHONY: help lint test conformance check fmt msrv