Skip to content

Commit 9de2e59

Browse files
authored
Merge pull request #1453 from codeflash-ai/claude-md-mypy-instructions
docs: add mypy type checking instructions to CLAUDE.md
2 parents 3dd19c6 + afed6a3 commit 9de2e59

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,29 @@ uv run ruff format codeflash/ # Format
2727
# Linting (run before committing)
2828
uv run prek run --from-ref origin/main
2929

30+
# Mypy type checking (run on changed files before committing)
31+
uv run mypy --non-interactive --config-file pyproject.toml <changed_files>
32+
3033
# Running the CLI
3134
uv run codeflash --help
3235
uv run codeflash init # Initialize in a project
3336
uv run codeflash --all # Optimize entire codebase
3437
```
3538

39+
## Mypy Type Checking
40+
41+
When modifying code, fix any mypy type errors in the files you changed. Run mypy on changed files:
42+
43+
```bash
44+
uv run mypy --non-interactive --config-file pyproject.toml <changed_files>
45+
```
46+
47+
Rules:
48+
- Fix type annotation issues: missing return types, incorrect types, Optional/None unions, import errors for type hints
49+
- Do NOT add `# type: ignore` comments — always fix the root cause
50+
- Do NOT fix type errors that require logic changes, complex generic type rework, or anything that could change runtime behavior
51+
- Files in `mypy_allowlist.txt` are checked in CI — ensure they remain error-free
52+
3653
<!-- Section below is auto-generated by `tessl install` - do not edit manually -->
3754

3855
# Agent Rules <!-- tessl-managed -->

0 commit comments

Comments
 (0)