.PHONY: help build test clean lint fmt doc bench install uninstall check release pre-commit audit security
help:
@echo "Available targets:"
@awk 'BEGIN {FS = ":.*##"; printf "\033[36m%-20s\033[0m %s\n", "Target", "Description"} /^[a-zA-Z_-]+:.*?##/ { printf "\033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
build:
cargo build
build-release:
cargo build --release
test:
cargo test
test-verbose:
cargo test --verbose
clean:
cargo clean
lint:
cargo clippy --all-targets --all-features -- -D warnings
fmt:
cargo fmt
fmt-check:
cargo fmt --check
doc:
cargo doc --all --no-deps --open
doc-check:
cargo doc --all --no-deps --document-private-items
bench:
cargo bench
install:
cargo install --path .
uninstall:
cargo uninstall tinify-rs
check: fmt-check lint test doc-check
audit:
cargo audit
deny:
cargo deny check
changelog:
git cliff --output CHANGELOG.md
pre-release: check audit deny
@echo "All pre-release checks passed!"
release-dry-run:
cargo publish --dry-run
release:
cargo publish
install-tools:
cargo install cargo-audit cargo-deny git-cliff cargo-tarpaulin typos-cli
typos:
typos
typos-fix:
typos --write-changes
coverage:
cargo tarpaulin --out Html --output-dir target/coverage
setup-hooks:
echo "make pre-commit" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
pre-commit: fmt-check lint typos
@echo "Pre-commit checks passed!"
run-examples:
@for example in examples/*.rs; do \
echo "Running $$example..."; \
cargo run --example $$(basename $$example .rs) || exit 1; \
done
clean-all: clean
cargo clean
rm -rf target/
rm -rf ~/.cargo/registry/