Skip to content

Commit 2d2accb

Browse files
authored
chore: add a makefile to run linter/testing/type safety check (#42)
<!-- Describe what has changed in this PR --> **What changed?** add a makefile to run linter/testing/type safety check, now we can run `make pr` to check all the linter etc. in one go. <!-- Tell your future self why have you made these changes --> **Why?** it's sometimes confusion for all the different `uv run` commands to either run test, linter. <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> **How did you test it?** only makefile <!-- Assuming the worst case, what can be broken when deploying this change to production? --> **Potential risks** <!-- Is it notable for release? e.g. schema updates, configuration or data migration required? If so, please mention it, and also update CHANGELOG.md --> **Release notes** <!-- Is there any documentation updates should be made for config, https://cadenceworkflow.io/docs/operation-guide/setup/ ? If so, please open an PR in https://github.com/cadence-workflow/cadence-docs --> **Documentation Changes** --------- Signed-off-by: Tim Li <[email protected]>
1 parent abba8c2 commit 2d2accb

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

Makefile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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

Comments
 (0)