|
| 1 | +.PHONY: pr install lint type-check test integration-test clean generate help |
| 2 | + |
| 3 | +# Run all PR checks locally |
| 4 | +pr: install generate lint type-check test integration-test |
| 5 | + @echo "All PR checks passed!" |
| 6 | + |
| 7 | +# Install dependencies |
| 8 | +install: |
| 9 | + @echo "Installing dependencies..." |
| 10 | + uv sync --extra dev |
| 11 | + |
| 12 | +# Generate idl files |
| 13 | +generate: |
| 14 | + @echo "Generating type files based on IDL..." |
| 15 | + uv run python scripts/generate_proto.py |
| 16 | + |
| 17 | +# Run linter |
| 18 | +lint: |
| 19 | + @echo "Running Ruff linter and fixing lint issues..." |
| 20 | + uv tool run ruff check --fix |
| 21 | + |
| 22 | +# Run type checker |
| 23 | +type-check: |
| 24 | + @echo "Running mypy type checker..." |
| 25 | + uv tool run mypy cadence/ |
| 26 | + |
| 27 | +# Run unit tests |
| 28 | +test: |
| 29 | + @echo "Running unit tests..." |
| 30 | + uv run pytest -v |
| 31 | + |
| 32 | +# Run integration tests |
| 33 | +integration-test: |
| 34 | + @echo "Running integration tests..." |
| 35 | + uv run pytest -v --integration-tests |
| 36 | + |
| 37 | +# Clean generated files and caches |
| 38 | +clean: |
| 39 | + @echo "Cleaning up..." |
| 40 | + find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true |
| 41 | + find . -type f -name "*.pyc" -delete 2>/dev/null || true |
| 42 | + find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true |
| 43 | + |
| 44 | +# Show help |
| 45 | +help: |
| 46 | + @echo "Available targets:" |
| 47 | + @echo " make pr - Run all PR checks (recommended before submitting PR)" |
| 48 | + @echo " make install - Install dependencies" |
| 49 | + @echo " make lint - Run Ruff linter" |
| 50 | + @echo " make type-check - Run mypy type checker" |
| 51 | + @echo " make test - Run unit tests" |
| 52 | + @echo " make integration-test - Run integration tests" |
| 53 | + @echo " make clean - Remove generated files and caches" |
| 54 | + @echo " make help - Show this help message" |
| 55 | + |
0 commit comments