Skip to content

Commit ef1a576

Browse files
authored
add instruction for claude to use TYPE_CHECKING (#4074)
##### Short description: Add Claude instruction to use `TYPE_CHECKING` when import is needed only for type-hinting Assisted by: Cursor ##### More details: ##### What this PR does / why we need it: ##### Which issue(s) this PR fixes: ##### Special notes for reviewer: ##### jira-ticket:
1 parent a020831 commit ef1a576

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Before writing ANY new code:
2929
### Python Requirements
3030

3131
- **Type hints MANDATORY** - mypy strict mode in `libs/`, all new public functions under utilities MUST be typed
32+
- **Use `TYPE_CHECKING` for type-only imports** - wrap imports needed solely for type hints in `if TYPE_CHECKING:` to avoid runtime overhead and circular imports
3233
- **Google-format docstrings REQUIRED** - for all public functions with non-obvious return values OR side effects
3334
- **No defensive programming** - fail-fast, don't hide bugs with fake defaults (see exceptions below)
3435
- **ALWAYS use `uv run`** - NEVER execute `python`, `pip`, or `pytest` directly. Use `uv run python`, `uv run pytest`, `uv add` for package installation.

0 commit comments

Comments
 (0)