- Moved all hookify configuration files from `.claude/` to `.claude/hooks/` subdirectory for better organization - Added four new blocking hooks to prevent common error handling anti-patterns: - `block-broad-exception-handler`: Prevents catching generic `Exception` with only logging - `block-datetime-now-fallback`: Blocks returning `datetime.now()` as fallback on parse failures to prevent data corruption - `block-default
1.2 KiB
1.2 KiB
name, enabled, event, action, conditions
| name | enabled | event | action | conditions | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| block-test-loops-conditionals | true | file | block |
|
🚫 Test Quality Violation: Loops or Conditionals in Tests
Your edit contains a loop (for/while) or conditional (if) combined with assertions in a test file.
Why this is blocked:
- Tests should be deterministic and explicit
- Loops hide which iteration failed
- Conditionals make test behavior unpredictable
- This violates the project's test quality standards (see
tests/quality/)
Alternatives:
-
Use
@pytest.mark.parametrizefor multiple test cases:@pytest.mark.parametrize("input,expected", [ ("a", 1), ("b", 2), ]) def test_example(input, expected): assert process(input) == expected -
Create separate test functions for distinct scenarios
-
Use fixtures for setup variations
Project reference: See tests/quality/ for the 23 test smell checks enforced on this codebase.