.PHONY: help build test fmt lint check clean install run docker pre-commit all
help:
@echo "Headwind Development Commands:"
@echo ""
@echo " make build - Build the project"
@echo " make test - Run tests"
@echo " make fmt - Format code"
@echo " make lint - Run clippy lints"
@echo " make check - Check compilation without building"
@echo " make clean - Clean build artifacts"
@echo " make install - Install development tools"
@echo " make run - Run the project locally"
@echo " make docker - Build Docker image"
@echo " make pre-commit - Run pre-commit hooks"
@echo " make all - Run fmt, lint, and test"
@echo ""
build:
@echo "Building project..."
cargo build
build-release:
@echo "Building release..."
cargo build --release
test:
@echo "Running tests..."
cargo test --all-features
test-verbose:
@echo "Running tests (verbose)..."
cargo test --all-features -- --nocapture
fmt:
@echo "Formatting code..."
cargo fmt --all
fmt-check:
@echo "Checking code formatting..."
cargo fmt --all -- --check
lint:
@echo "Running clippy..."
cargo clippy --all-features --all-targets -- -D warnings
check:
@echo "Checking compilation..."
cargo check --all-features --all-targets
clean:
@echo "Cleaning build artifacts..."
cargo clean
install:
@echo "Installing development tools..."
cargo install cargo-audit
cargo install cargo-deny
cargo install cargo-udeps
cargo install cargo-tarpaulin
cargo install cargo-watch
pip install pre-commit
pre-commit install
run:
@echo "Running headwind..."
RUST_LOG=headwind=debug cargo run
watch:
@echo "Watching for changes..."
cargo watch -x test
docker:
@echo "Building Docker image..."
docker build -t headwind:dev .
docker-run:
@echo "Running Docker container..."
docker run --rm -it headwind:dev
kind-load:
@echo "Loading Docker image into kind..."
docker build -t headwind:dev .
kind load docker-image headwind:dev
audit:
@echo "Running security audit..."
cargo audit
deny:
@echo "Checking dependencies..."
cargo deny check
udeps:
@echo "Checking for unused dependencies..."
cargo +nightly udeps --all-targets
docs:
@echo "Generating documentation..."
cargo doc --all-features --no-deps --open
pre-commit:
@echo "Running pre-commit hooks..."
pre-commit run --all-files
coverage:
@echo "Generating code coverage..."
cargo tarpaulin --all-features --workspace --timeout 120 --out Html
all: fmt lint test
@echo "✓ All checks passed!"
ci: fmt-check lint test check audit deny
@echo "✓ CI checks passed!"
quick: fmt lint
@echo "✓ Quick checks passed!"