.PHONY: all
all: test fmt lint build
.PHONY: build
build:
cargo build
.PHONY: release
release:
cargo build --release
.PHONY: test
test:
cargo test
.PHONY: fmt
fmt:
cargo +stable fmt --all
.PHONY: fmt-check
fmt-check:
cargo +stable fmt --check
.PHONY: lint
lint:
cargo clippy --all-targets --all-features -- -D warnings
.PHONY: lint-fix
lint-fix:
cargo clippy --fix --all-targets --all-features --allow-dirty --allow-staged -- -D warnings
.PHONY: clean
clean:
cargo clean
.PHONY: check
check: test fmt-check lint
.PHONY: run
run:
cargo run
.PHONY: fix
fix:
cargo fix --allow-staged --allow-dirty
.PHONY: pre-push
pre-push: fix fmt lint-fix test
.PHONY: doc
doc:
cargo doc --open
.PHONY: publish
publish:
cargo login ${CARGO_REGISTRY_TOKEN}
cargo package
cargo publish
.PHONY: coverage
coverage:
cargo install cargo-tarpaulin
mkdir -p coverage
cargo tarpaulin --all-features --workspace --timeout 120 --out Xml
.PHONY: coverage-html
coverage-html:
cargo install cargo-tarpaulin
mkdir -p coverage
cargo tarpaulin --all-features --workspace --timeout 120 --out Html