.PHONY: help setup build test fmt lint check clean run docs
help:
@echo "LogAI Development Commands"
@echo ""
@echo "Setup:"
@echo " make setup Setup development environment (hooks + deps)"
@echo ""
@echo "Development:"
@echo " make build Build release binary"
@echo " make test Run tests"
@echo " make fmt Format code (Rust + Markdown)"
@echo " make lint Run clippy"
@echo " make check Run all checks (fmt, lint, test)"
@echo " make run Run with example logs"
@echo ""
@echo "Documentation:"
@echo " make docs Generate and open Rust docs"
@echo ""
@echo "Cleanup:"
@echo " make clean Clean build artifacts"
setup:
@echo "๐ Setting up development environment..."
@git config core.hooksPath hooks
@chmod +x hooks/pre-commit
@cargo fetch
@echo "โ
Setup complete! Git hooks configured and dependencies fetched."
build:
@echo "๐จ Building release binary..."
@cargo build --release
test:
@echo "๐งช Running tests..."
@cargo test --all-features
fmt:
@echo "๐ Formatting Rust code..."
@cargo fmt --all
@if command -v prettier >/dev/null 2>&1; then \
echo "๐ Formatting markdown..."; \
prettier --write "*.md" "docs/*.md" "examples/*.md" "scripts/*.md" 2>/dev/null || true; \
fi
lint:
@echo "๐ง Running clippy..."
@cargo clippy --all-targets --all-features -- -D warnings
check: fmt lint test
@echo "โ
All checks passed!"
clean:
@echo "๐งน Cleaning..."
@cargo clean
run:
@echo "๐ Running logai with example logs..."
@cargo run -- investigate examples/logs/nginx-sample.log --ai none
docs:
@echo "๐ Generating documentation..."
@cargo doc --no-deps --open