.PHONY: help
help:
@echo "PDMT - Deterministic MCP Templating Library"
@echo ""
@echo "Available targets:"
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: all
all: format lint test
.PHONY: clean
clean:
cargo clean
rm -rf target/
rm -rf .pdmt-cache/
rm -rf proptest-regressions/
.PHONY: format
format:
@echo "๐จ Formatting code..."
cargo fmt --all
@echo "โ
Code formatted successfully"
.PHONY: format-check
format-check:
@echo "๐ Checking code formatting..."
cargo fmt --all -- --check
@echo "โ
Code formatting is correct"
.PHONY: lint
lint:
@echo "๐ Running linting checks..."
@cargo clippy --all-targets --all-features 2>&1 | grep -E "^error:" || true
@if cargo clippy --all-targets --all-features 2>&1 | grep -q "^error:"; then \
echo "โ Linting errors found"; \
exit 1; \
else \
echo "โ
All linting checks passed (warnings allowed)"; \
fi
.PHONY: lint-fix
lint-fix:
@echo "๐ง Auto-fixing linting issues..."
cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged
@echo "โ
Auto-fix completed"
.PHONY: test
test:
@echo "๐งช Running tests with coverage..."
@cargo tarpaulin --all-features --workspace --timeout 120 --skip-clean --fail-under 80 || \
(echo "โ Tests failed or coverage is below 80%"; exit 1)
@echo "โ
All tests passed with โฅ80% coverage"
.PHONY: test-unit
test-unit:
@echo "๐งช Running unit tests..."
cargo test --lib --all-features
@echo "โ
Unit tests passed"
.PHONY: test-integration
test-integration:
@echo "๐งช Running integration tests..."
cargo test --test '*' --all-features
@echo "โ
Integration tests passed"
.PHONY: test-doc
test-doc:
@echo "๐งช Running documentation tests..."
cargo test --doc --all-features
@echo "โ
Documentation tests passed"
.PHONY: test-examples
test-examples:
@echo "๐งช Testing examples..."
cargo run --example todo_generation --features todo-validation -- --project "Test Project" --requirements "Test req1,Test req2" --granularity high --max-todos 5 --output-format yaml
@echo "โ
Examples tested successfully"
.PHONY: coverage
coverage:
@echo "๐ Generating detailed coverage report..."
@cargo tarpaulin --all-features --workspace --timeout 120 --skip-clean \
--out Html --output-dir target/coverage --fail-under 80
@echo "โ
Coverage report generated in target/coverage/"
@echo "๐ View report: open target/coverage/tarpaulin-report.html"
.PHONY: bench
bench:
@echo "โก Running benchmarks..."
cargo bench --all-features
@echo "โ
Benchmarks completed"
.PHONY: docs
docs:
@echo "๐ Generating documentation..."
cargo doc --all-features --no-deps --document-private-items
@echo "โ
Documentation generated"
.PHONY: docs-open
docs-open: docs
@echo "๐ Opening documentation..."
cargo doc --all-features --no-deps --open
.PHONY: audit
audit:
@echo "๐ Running security audit..."
cargo audit
@echo "โ
Security audit passed"
.PHONY: check-release
check-release: format lint test audit
@echo "๐ Running full release check..."
cargo check --release --all-features
cargo build --release --all-features
@echo "โ
Release check passed"
.PHONY: dev
dev:
@echo "๐ฅ Starting development mode..."
cargo watch -x 'run --example todo_generation --features todo-validation'
.PHONY: install-tools
install-tools:
@echo "๐ง Installing development tools..."
rustup component add rustfmt clippy
cargo install cargo-watch cargo-tarpaulin cargo-audit --locked || true
@echo "โ
Development tools installed"
.PHONY: build
build:
@echo "๐จ Building project..."
cargo build --all-features
@echo "โ
Build completed"
.PHONY: build-release
build-release:
@echo "๐จ Building release version..."
cargo build --release --all-features
@echo "โ
Release build completed"
.PHONY: build-minimal
build-minimal:
@echo "๐จ Building minimal version..."
cargo build --no-default-features
@echo "โ
Minimal build completed"
.PHONY: build-full
build-full:
@echo "๐จ Building with all features..."
cargo build --all-features
@echo "โ
Full build completed"
.PHONY: ci-check
ci-check: format-check lint test
@echo "๐ค Running CI checks..."
@echo "โ
All CI checks passed"
.PHONY: pre-commit
pre-commit: format lint test-unit
@echo "โจ Running pre-commit checks..."
@echo "โ
Pre-commit checks passed"