.PHONY: help check fmt fmt-check clippy test build build-release clean all ci
help:
@echo "Available targets:"
@echo " make check - Run all checks (format + clippy + test)"
@echo " make fmt - Format code with rustfmt"
@echo " make fmt-check - Check code formatting without modifying"
@echo " make clippy - Run clippy linter with strict warnings"
@echo " make test - Run all tests"
@echo " make build - Build in debug mode"
@echo " make build-release- Build in release mode"
@echo " make clean - Clean build artifacts"
@echo " make ci - Run all CI checks (same as GitHub Actions)"
@echo " make all - Format, build, and test"
ci: fmt-check clippy test
@echo "โ
All CI checks passed!"
check: fmt clippy test
@echo "โ
All checks passed!"
fmt:
@echo "๐ง Formatting code..."
@cargo fmt
fmt-check:
@echo "๐ Checking code formatting..."
@cargo fmt -- --check
clippy:
@echo "๐ Running clippy..."
@cargo clippy --all-targets --all-features -- -D warnings
test:
@echo "๐งช Running tests..."
@cargo test --all-features
build:
@echo "๐จ Building (debug mode)..."
@cargo build --all-features
build-release:
@echo "๐จ Building (release mode)..."
@cargo build --release --all-features
clean:
@echo "๐งน Cleaning build artifacts..."
@cargo clean
all: fmt build test
@echo "โ
Build and test completed!"
bench:
@echo "๐ Running benchmarks..."
@cargo bench
examples:
@echo "๐จ Building all examples..."
@cargo build --examples --all-features
example-%:
@echo "๐จ Building example: $*..."
@cargo build --example $*
run-example-%:
@echo "๐ Running example: $*..."
@cargo run --example $*
verbose:
@echo "๐ Running with verbose output..."
@cargo build --verbose --all-features
@cargo test --verbose --all-features
doc:
@echo "๐ Building documentation..."
@cargo doc --all-features --no-deps
doc-open:
@echo "๐ Opening documentation..."
@cargo doc --all-features --no-deps --open
update:
@echo "๐ฆ Updating dependencies..."
@cargo update
outdated:
@echo "๐ฆ Checking for outdated dependencies..."
@cargo outdated || echo "Install cargo-outdated: cargo install cargo-outdated"
audit:
@echo "๐ Running security audit..."
@cargo audit || echo "Install cargo-audit: cargo install cargo-audit"
coverage:
@echo "๐ Generating coverage report..."
@cargo tarpaulin --all-features || echo "Install cargo-tarpaulin: cargo install cargo-tarpaulin"
pre-commit: fmt clippy test
@echo "โ
Pre-commit checks passed!"
pre-push: ci
@echo "โ
Ready to push!"