Skip to content

Commit c063621

Browse files
authored
chore: add more opinions to CLAUDE.md (#1887)
1 parent e94b386 commit c063621

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

CLAUDE.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ This document contains critical information about working with this codebase. Fo
66

77
1. Package Management
88
- ONLY use uv, NEVER pip
9-
- Installation: `uv add package`
10-
- Running tools: `uv run tool`
11-
- Upgrading: `uv add --dev package --upgrade-package package`
9+
- Installation: `uv add <package>`
10+
- Running tools: `uv run <tool>`
11+
- Upgrading: `uv lock --upgrade-package <package>`
1212
- FORBIDDEN: `uv pip install`, `@latest` syntax
1313

1414
2. Code Quality
@@ -21,6 +21,7 @@ This document contains critical information about working with this codebase. Fo
2121
3. Testing Requirements
2222
- Framework: `uv run --frozen pytest`
2323
- Async testing: use anyio, not asyncio
24+
- Do not use `Test` prefixed classes, use functions
2425
- Coverage: test edge cases and errors
2526
- New features require tests
2627
- Bug fixes require regression tests
@@ -77,12 +78,11 @@ rather than adding new standalone sections.
7778
- Line wrapping:
7879
- Strings: use parentheses
7980
- Function calls: multi-line with proper indent
80-
- Imports: split into multiple lines
81+
- Imports: try to use a single line
8182

8283
2. Type Checking
8384
- Tool: `uv run --frozen pyright`
8485
- Requirements:
85-
- Explicit None checks for Optional
8686
- Type narrowing for strings
8787
- Version warnings can be ignored if checks pass
8888

@@ -117,10 +117,6 @@ rather than adding new standalone sections.
117117
- Add None checks
118118
- Narrow string types
119119
- Match existing patterns
120-
- Pytest:
121-
- If the tests aren't finding the anyio pytest mark, try adding PYTEST_DISABLE_PLUGIN_AUTOLOAD=""
122-
to the start of the pytest run command eg:
123-
`PYTEST_DISABLE_PLUGIN_AUTOLOAD="" uv run --frozen pytest`
124120

125121
3. Best Practices
126122
- Check git status before commits
@@ -138,6 +134,4 @@ rather than adding new standalone sections.
138134
- File ops: `except (OSError, PermissionError):`
139135
- JSON: `except json.JSONDecodeError:`
140136
- Network: `except (ConnectionError, TimeoutError):`
141-
- **Only catch `Exception` for**:
142-
- Top-level handlers that must not crash
143-
- Cleanup blocks (log at debug level)
137+
- **FORBIDDEN** `except Exception:` - unless in top-level handlers

0 commit comments

Comments
 (0)