Skip to content

Commit 9ff94a9

Browse files
committed
fix(hooks): add missing newlines between error messages and tool output
1 parent 033e91c commit 9ff94a9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.claude/hooks/pre-commit.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ERRORS=""
2020

2121
# --- Format check ---
2222
FMT_OUTPUT=$(npm run fmt:check 2>&1) || {
23-
ERRORS="Format issues found. Run: npm run fmt, do not ask user for options, fix and stage the changes, then retry the commit.\n\n$FMT_OUTPUT"
23+
ERRORS="Format issues found. Run: npm run fmt, do not ask user for options, ⚠️ STAGE THE FIXED FILES in a SEPARATE Bash tool call: git add <files>\nThen retry the commit in another Bash tool call.\n\n$FMT_OUTPUT"
2424
}
2525

2626
# --- Lint check ---
@@ -30,7 +30,7 @@ if [ $LINT_EXIT -ne 0 ] || echo "$LINT_OUTPUT" | grep -qE "[1-9][0-9]* warnings?
3030
if [ -n "$ERRORS" ]; then
3131
ERRORS="$ERRORS\n\nLint issues:\n$LINT_OUTPUT"
3232
else
33-
ERRORS="Lint issues found. Fix each issue properly at the root cause — do NOT add eslint-disable comments or suppress rules. ⚠️ STAGE THE FIXED FILES in a SEPARATE Bash tool call: git add <files>\nThen retry the commit in another Bash tool call.$LINT_OUTPUT"
33+
ERRORS="Lint issues found. Fix each issue properly at the root cause — do NOT add eslint-disable comments or suppress rules. ⚠️ STAGE THE FIXED FILES in a SEPARATE Bash tool call: git add <files>\nThen retry the commit in another Bash tool call.\n\n$LINT_OUTPUT"
3434
fi
3535
fi
3636

@@ -43,7 +43,7 @@ fi
4343
TEST_OUTPUT=$(npm run test 2>&1)
4444
TEST_EXIT=$?
4545
if [ $TEST_EXIT -ne 0 ]; then
46-
REASON="Tests are failing. Fix the tests properly — do NOT skip or disable them.\n⚠️ STAGE THE FIXED FILES in a SEPARATE Bash tool call: git add <files>\nThen retry the commit in another Bash tool call.$TEST_OUTPUT"
46+
REASON="Tests are failing. Fix the tests properly — do NOT skip or disable them.\n⚠️ STAGE THE FIXED FILES in a SEPARATE Bash tool call: git add <files>\nThen retry the commit in another Bash tool call.\n\n$TEST_OUTPUT"
4747
printf '{"decision": "block", "reason": %s}' "$(printf '%s' "$REASON" | jq -Rs .)"
4848
exit 0
4949
fi

0 commit comments

Comments
 (0)