.DEFAULT_GOAL := help
bootstrap:
rustup show >/dev/null
cargo --version
cargo fmt --version
cargo clippy --version
pre-commit install --hook-type commit-msg --hook-type pre-commit
format:
cargo fmt
format-check:
cargo fmt -- --check
lint:
cargo clippy --all-targets --all-features -- -D warnings
lint-fix:
cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged -- -D warnings
check-build:
cargo check
test:
cargo test
pre-commit:
pre-commit run --all-files
check-commit:
cz check --commit-msg-file "$$(git rev-parse --git-path COMMIT_EDITMSG)"
check: format-check lint check-build check-commit
ci: format-check lint test check-build
fix: format lint-fix
clean:
cargo clean
help:
@awk 'BEGIN{tabstop=8;targetcol=32} /^##/{desc=$$0;sub(/^##[ ]*/,"",desc);next} /^[a-zA-Z0-9_-]+:/{name=$$1;sub(/:.*/,"",name);col=length(name);pos=col;ntabs=0;while(pos<targetcol){ntabs++;pos=int(pos/tabstop+1)*tabstop}printf "%s",name;for(i=0;i<ntabs;i++)printf "\t";printf "%s\n",desc;desc=""}' Makefile