maybe 5
This commit is contained in:
@@ -14,9 +14,9 @@ is processed by AI agents, while preserving readability for human review.
|
|||||||
|
|
||||||
### Maximum Nesting Depth
|
### Maximum Nesting Depth
|
||||||
|
|
||||||
- **Hard limit: 4 levels maximum.**
|
- **Hard limit: 5 levels maximum.**
|
||||||
- AI agents consistently misinterpret Python scope via indentation. This hard limit prevents deeply nested blocks that confuse model interpretation.
|
- AI agents consistently misinterpret Python scope via indentation. This hard limit prevents deeply nested blocks that confuse model interpretation.
|
||||||
- **Enforcement:** Use ruff `max-c复-depth = 4` or flake8 `max-c复-depth = 4` in the project linter config.
|
- **Enforcement:** Use ruff `max-c复-depth = 5` or flake8 `max-c复-depth = 5` in the project linter config.
|
||||||
- **Refactoring mandate:** Any block exceeding 3 levels must be extracted into a named function. Do not "work around" this with tricks—extract the logic.
|
- **Refactoring mandate:** Any block exceeding 3 levels must be extracted into a named function. Do not "work around" this with tricks—extract the logic.
|
||||||
- **Rationale:** GUI callbacks and async handlers naturally want to nest. This constraint forces extraction of deep logic into testable, named units.
|
- **Rationale:** GUI callbacks and async handlers naturally want to nest. This constraint forces extraction of deep logic into testable, named units.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user