This repository was archived by the owner on Jan 2, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhooks.json
More file actions
58 lines (58 loc) · 2.15 KB
/
Copy pathhooks.json
File metadata and controls
58 lines (58 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
"$schema": "https://claude.ai/hooks-schema.json",
"hooks": [
{
"name": "format-on-edit",
"description": "Auto-format Python files with ruff (matches CI: ruff format)",
"event": "PostToolUse",
"matcher": "Write|Edit|str_replace_editor",
"type": "command",
"command": "cd \"$CLAUDE_PROJECT_DIR\" && uv run ruff format $CLAUDE_FILE_PATHS 2>/dev/null || true",
"conditions": {
"fileExtensions": [".py", ".pyi"]
}
},
{
"name": "lint-check-on-edit",
"description": "Check lint errors with ruff (matches CI: ruff check src/ tests/)",
"event": "PostToolUse",
"matcher": "Write|Edit|str_replace_editor",
"type": "command",
"command": "cd \"$CLAUDE_PROJECT_DIR\" && uv run ruff check $CLAUDE_FILE_PATHS --output-format=concise 2>/dev/null | head -20 || true",
"conditions": {
"fileExtensions": [".py", ".pyi"]
}
},
{
"name": "typecheck-on-edit",
"description": "Type check with mypy strict mode (matches CI: mypy src/)",
"event": "PostToolUse",
"matcher": "Write|Edit|str_replace_editor",
"type": "command",
"command": "cd \"$CLAUDE_PROJECT_DIR\" && uv run mypy $CLAUDE_FILE_PATHS 2>&1 | grep -E 'error:' | head -10 || true",
"conditions": {
"fileExtensions": [".py", ".pyi"]
}
},
{
"name": "security-scan-on-edit",
"description": "Security scan with bandit (matches CI: bandit -r src/ -ll)",
"event": "PostToolUse",
"matcher": "Write|Edit|str_replace_editor",
"type": "command",
"command": "cd \"$CLAUDE_PROJECT_DIR\" && uv run bandit -ll $CLAUDE_FILE_PATHS 2>/dev/null | grep -E '^>>' | head -10 || true",
"conditions": {
"fileExtensions": [".py"]
}
},
{
"name": "pre-commit-quality-gate",
"description": "Full CI quality check before git commits (format, lint, typecheck, security, tests)",
"event": "PreToolUse",
"matcher": "Bash",
"type": "command",
"command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -qE 'git commit'; then cd \"$CLAUDE_PROJECT_DIR\" && make quality; fi",
"blocking": true
}
]
}