claude-dev-env 1.21.0 → 1.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/CODE_RULES.md +5 -3
- package/package.json +1 -1
package/docs/CODE_RULES.md
CHANGED
|
@@ -10,7 +10,9 @@ Compact reference for agents. Hook-enforced rules marked with ⚡.
|
|
|
10
10
|
|
|
11
11
|
- Existing comments are SACRED — never delete, rewrite, or "clean up" existing comments
|
|
12
12
|
- New inline comments are not needed — write self-documenting code instead
|
|
13
|
+
- Module-level docstrings are allowed in all files
|
|
13
14
|
- Docstrings for new files/methods/classes are allowed
|
|
15
|
+
- **Test files are exempt:** comments and docstrings inside test functions are allowed
|
|
14
16
|
- The hook enforces BOTH directions: blocks new inline comments AND blocks deletion of existing comments
|
|
15
17
|
|
|
16
18
|
**Scope:** Only evaluate comments on lines YOU are actively changing. If code is untouched, its comments are untouched.
|
|
@@ -41,12 +43,12 @@ These rules are automatically enforced by `code-rules-enforcer.py`. Violations b
|
|
|
41
43
|
|
|
42
44
|
| Rule | What's Checked |
|
|
43
45
|
|------|----------------|
|
|
44
|
-
| No NEW comments | `#` / `//` in new code only (existing comments NEVER removed; shebangs, type:, noqa, eslint, docstrings exempt) |
|
|
46
|
+
| No NEW comments | `#` / `//` in new production code only (existing comments NEVER removed; shebangs, type:, noqa, eslint, docstrings, module docstrings, and all test files exempt) |
|
|
45
47
|
| Imports at top | No `import` inside function bodies |
|
|
46
48
|
| Logging format args | No `log_*(f"...")` - use `log_*("...", arg)` |
|
|
47
49
|
| File line count | Advisory only — see [File length guidance](#65-file-length-guidance) |
|
|
48
|
-
| Magic values | No literals in function bodies (0, 1, -1 exempt). Includes string templates — if you strip the interpolations from an f-string and the remaining literal text is structural (paths, URLs, patterns), those fragments are magic values that belong in config |
|
|
49
|
-
| Constants location | No `UPPER_SNAKE =` outside `config/` |
|
|
50
|
+
| Magic values | No literals in production function bodies (0, 1, -1 exempt). **Test files exempt.** Includes string templates — if you strip the interpolations from an f-string and the remaining literal text is structural (paths, URLs, patterns), those fragments are magic values that belong in config |
|
|
51
|
+
| Constants location | No `UPPER_SNAKE =` outside `config/` in **production code**. **Test files may define local constants.** |
|
|
50
52
|
|
|
51
53
|
---
|
|
52
54
|
|