.PHONY: build run test lint fmt check clean docker docker-run coverage audit help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
build:
cargo build
release:
cargo build --release
run:
cargo run
run-release:
cargo run --release
test:
cargo test
test-verbose:
cargo test -- --nocapture
lint:
cargo clippy --all-targets --all-features -- -D warnings
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all -- --check
check: fmt-check lint test
coverage:
cargo tarpaulin --out html --output-dir coverage/
@echo "Coverage report: coverage/tarpaulin-report.html"
audit:
cargo audit
clean:
cargo clean
rm -rf coverage/
docker:
docker build -t rust-chess .
docker-run:
docker run -p 8082:8082 --rm rust-chess
docker-size:
docker images rust-chess --format "{{.Repository}}:{{.Tag}} — {{.Size}}"