@@ -29,10 +29,15 @@ This file is intended to be used by an LLM such as Claude.
29
29
- Handles both formatting and linting
30
30
- For formatting: ` uv run ruff format . `
31
31
- For checking: ` uv run ruff check . `
32
+ - For auto-fixing: ` uv run ruff check . --fix `
32
33
- Common issues:
33
34
- Line length (default 88 chars)
34
- - Import sorting
35
+ - Import sorting (I001 errors)
35
36
- Unused imports
37
+ - When line length errors occur:
38
+ - For strings, use parentheses and line continuation
39
+ - For function calls, use multiple lines with proper indentation
40
+ - For imports, split into multiple lines
36
41
37
42
### Pyright
38
43
- Type checker
@@ -42,6 +47,18 @@ This file is intended to be used by an LLM such as Claude.
42
47
- Optional types need explicit None checks
43
48
- String operations need type narrowing
44
49
50
+ ## Pre-commit Hooks
51
+
52
+ - Configuration in ` .pre-commit-config.yaml `
53
+ - Runs automatically on git commit
54
+ - Includes:
55
+ - Prettier for YAML/JSON formatting
56
+ - Ruff for Python formatting and linting
57
+ - When updating ruff version:
58
+ - Check available versions on PyPI
59
+ - Update ` rev ` in config to match available version
60
+ - Add and commit config changes before other changes
61
+
45
62
## Best Practices
46
63
47
64
1 . Always check git status and diff before committing
0 commit comments