Skip to content

Commit 7cf2e4e

Browse files
committed
feat(ci): add mypy checks to Claude PR review workflow
Claude will now run mypy on changed files and fix type annotation issues.
1 parent fe9f22b commit 7cf2e4e

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/claude.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,28 @@ jobs:
5454
PR NUMBER: ${{ github.event.pull_request.number }}
5555
EVENT: ${{ github.event.action }}
5656
57-
## STEP 1: Run prek checks and fix issues
57+
## STEP 1: Run prek and mypy checks, fix issues
5858
59-
First, run `uv run prek run --from-ref origin/main` to check for linting/formatting issues on files changed in this PR.
59+
First, run these checks on files changed in this PR:
60+
1. `uv run prek run --from-ref origin/main` - linting/formatting issues
61+
2. `uv run mypy <changed_files>` - type checking issues
6062
61-
If there are any issues:
63+
If there are prek issues:
6264
- For SAFE auto-fixable issues (formatting, import sorting, trailing whitespace, etc.), run `uv run prek run --from-ref origin/main` again to auto-fix them
65+
66+
If there are mypy issues:
67+
- Fix type annotation issues (missing return types, Optional/None unions, import errors for type hints, incorrect types)
68+
- Do NOT add `type: ignore` comments - always fix the root cause
69+
70+
After fixing issues:
6371
- Stage the fixed files with `git add`
64-
- Commit with message "style: auto-fix linting issues"
72+
- Commit with message "style: auto-fix linting issues" or "fix: resolve mypy type errors" as appropriate
6573
- Push the changes with `git push`
6674
6775
Do NOT attempt to fix:
68-
- Type errors that require logic changes
69-
- Complex refactoring suggestions
70-
- Anything that could change behavior
76+
- Type errors that require logic changes or refactoring
77+
- Complex generic type issues
78+
- Anything that could change runtime behavior
7179
7280
## STEP 2: Review the PR
7381
@@ -148,7 +156,7 @@ jobs:
148156
2. If found, UPDATE it: `gh api --method PATCH repos/${{ github.repository }}/issues/comments/<ID> -f body="<content>"`
149157
3. If not found, CREATE: `gh pr comment ${{ github.event.pull_request.number }} --body "<content>"`
150158
4. Delete any OTHER claude[bot] comments to clean up duplicates: `gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '.[] | select(.user.login == "claude[bot]") | .id' | tail -n +2 | xargs -I {} gh api --method DELETE repos/${{ github.repository }}/issues/comments/{}`
151-
claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh api:*),Bash(uv run prek *),Bash(uv run coverage *),Bash(uv run pytest *),Bash(git status*),Bash(git add *),Bash(git commit *),Bash(git push*),Bash(git diff *),Bash(git checkout *),Read,Glob,Grep"'
159+
claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh api:*),Bash(uv run prek *),Bash(uv run mypy *),Bash(uv run coverage *),Bash(uv run pytest *),Bash(git status*),Bash(git add *),Bash(git commit *),Bash(git push*),Bash(git diff *),Bash(git checkout *),Read,Glob,Grep,Edit"'
152160
additional_permissions: |
153161
actions: read
154162
env:

0 commit comments

Comments
 (0)