.PHONY: help all build test lint format clean coverage examples bench install doc ci prepare-publish quality-gate
help:
@echo "Ruchy Language - Development Commands"
@echo ""
@echo "Core Commands:"
@echo " make build - Build the project in release mode"
@echo " make test - Run all tests"
@echo " make lint - Run clippy linter"
@echo " make format - Format code with rustfmt"
@echo " make clean - Clean build artifacts"
@echo ""
@echo "Quality Commands:"
@echo " make coverage - Generate test coverage report"
@echo " make quality-gate - Run PMAT quality checks"
@echo " make ci - Run full CI pipeline"
@echo ""
@echo "Development Commands:"
@echo " make examples - Run all examples"
@echo " make bench - Run benchmarks"
@echo " make doc - Generate documentation"
@echo " make install - Install ruchy locally"
@echo ""
@echo "Publishing:"
@echo " make prepare-publish - Prepare for crates.io publication"
build:
@echo "Building Ruchy..."
@cargo build --release
@echo "✓ Build complete"
test:
@echo "Running tests with nextest..."
@cargo nextest run --all-features --workspace --no-fail-fast
@cargo test --doc
@echo "✓ Tests completed"
test-lib:
@echo "Running library tests with nextest..."
@cargo nextest run --lib --all-features
@echo "✓ Library tests passed"
test-cargo:
@echo "Running tests with cargo test..."
@cargo test --all-features --workspace
@cargo test --doc
@echo "✓ All tests passed"
test-quick:
@echo "Running quick tests..."
@cargo nextest run --lib --profile quick
@echo "✓ Quick tests passed"
lint:
@echo "Running clippy..."
@cargo clippy --all-targets --all-features -- -D warnings
@echo "✓ Linting complete"
format:
@echo "Formatting code..."
@cargo fmt --all
@echo "✓ Formatting complete"
format-check:
@echo "Checking formatting..."
@cargo fmt --all -- --check
@echo "✓ Format check complete"
clean:
@echo "Cleaning..."
@cargo clean
@rm -rf target/
@rm -rf ~/.ruchy/cache/
@echo "✓ Clean complete"
coverage:
@echo "Generating coverage report with cargo-llvm-cov..."
@cargo install cargo-llvm-cov 2>/dev/null || true
@cargo llvm-cov clean --workspace
@cargo llvm-cov --all-features --workspace --html --output-dir target/coverage/html --lcov --output-path target/coverage/lcov.info --ignore-filename-regex "tests/|benches/|examples/"
@echo "✓ Coverage report generated in target/coverage/html/index.html"
@echo "Coverage summary:"
@cargo llvm-cov --summary-only --all-features --workspace 2>&1 | grep "TOTAL" || cargo llvm-cov --summary-only --all-features --workspace
examples:
@echo "Running examples..."
@echo ""
@echo "=== Parser Demo ==="
@cargo run --example parser_demo --quiet
@echo ""
@echo "=== Transpiler Demo ==="
@cargo run --example transpiler_demo --quiet
@echo ""
@echo "✓ All examples complete"
example-scripts:
@echo "Testing Ruchy scripts..."
@cargo run --package ruchy-cli --bin ruchy -- transpile examples/fibonacci.ruchy
@cargo run --package ruchy-cli --bin ruchy -- transpile examples/marco_polo.ruchy
@echo "✓ Script examples complete"
bench:
@echo "Running benchmarks..."
@cargo bench --workspace
@echo "✓ Benchmarks complete"
doc:
@echo "Generating documentation..."
@cargo doc --no-deps --workspace --all-features
@echo "✓ Documentation generated in target/doc"
install:
@echo "Installing ruchy..."
@cargo install --path ruchy-cli --force
@echo "✓ Ruchy installed to ~/.cargo/bin/ruchy"
quality-gate:
@echo "Running PMAT quality checks..."
@~/.local/bin/pmat quality-gate || true
@echo "Checking complexity..."
@~/.local/bin/pmat analyze --metrics complexity src/ || true
@echo "✓ Quality check complete"
ci: format-check lint test coverage quality-gate
@echo "✓ CI pipeline complete"
prepare-publish:
@echo "Preparing for crates.io publication..."
@echo "Checking package metadata..."
@cargo publish --dry-run --package ruchy
@cargo publish --dry-run --package ruchy-cli
@echo ""
@echo "Checklist for publication:"
@echo " [ ] Version numbers updated in Cargo.toml"
@echo " [ ] CHANGELOG.md updated"
@echo " [ ] README.md complete with examples"
@echo " [ ] Documentation complete"
@echo " [ ] All tests passing"
@echo " [ ] Coverage > 80%"
@echo " [ ] No clippy warnings"
@echo " [ ] PMAT quality gates passing"
@echo ""
@echo "To publish:"
@echo " cargo publish --package ruchy"
@echo " cargo publish --package ruchy-cli"
dev: format lint test
@echo "✓ Development checks complete"
all: clean build test lint format coverage examples bench doc quality-gate
@echo "✓ Full validation complete"