mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-11 08:47:33 +00:00
Add a PreToolUse hook (.claude/hooks/pre-push-spotless.sh, wired in .claude/settings.json) that runs spotlessApply before a git-push subcommand or the create_pull_request MCP tool. If spotless reformats tracked Kotlin, or reports a non-autofixable lint, the call is blocked so the fix is committed first -- turning CI's spotlessCheck failure into an in-session block. Gradle infra/network failures warn and allow, leaving CI as the backstop. Boundary detection tokenizes the command so the words appearing in a commit message do not trip the gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015nWg1Wwq5xCE7kPFzWY95o
39 lines
768 B
JSON
39 lines
768 B
JSON
{
|
|
"hooks": {
|
|
"PreToolUse": [
|
|
{
|
|
"matcher": "Bash|mcp__github__create_pull_request",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/pre-push-spotless.sh",
|
|
"timeout": 180
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"SessionStart": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"Stop": [
|
|
{
|
|
"matcher": "",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/stop-spotless.sh",
|
|
"timeout": 120
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|