Skip to content

Commit 27848a3

Browse files
Refine AI context files
1 parent b200cc3 commit 27848a3

1 file changed

Lines changed: 5 additions & 26 deletions

File tree

CLAUDE.md

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,11 @@ Common cookiecutter variables:
8181

8282
## Error Patterns to Avoid
8383

84-
```python
85-
# BAD: Using os.path
86-
import os
87-
file_path = os.path.join(os.getcwd(), "file.txt")
88-
89-
# GOOD: Using pathlib
90-
from pathlib import Path
91-
file_path = Path.cwd() / "file.txt"
92-
93-
# BAD: Print for logging
94-
print(f"Error: {error}")
95-
96-
# GOOD: Proper logging
97-
import logging
98-
logger = logging.getLogger(__name__)
99-
logger.error(f"Operation failed: {error}")
100-
101-
# BAD: Generic exceptions
102-
except Exception:
103-
pass
104-
105-
# GOOD: Specific handling
106-
except FileNotFoundError as e:
107-
logger.error(f"Configuration file not found: {e}")
108-
raise
109-
```
84+
| BAD | GOOD |
85+
|-----|------|
86+
| `os.path.join(os.getcwd(), "file.txt")` | `Path.cwd() / "file.txt"` (use `pathlib`) |
87+
| `print(f"Error: {error}")` | `logger.error(f"Operation failed: {error}")` (use `logging`) |
88+
| `except Exception: pass` | `except FileNotFoundError as e: logger.error(...); raise` |
11089

11190
## Testing Guidelines
11291

0 commit comments

Comments
 (0)