Repository navigation
fix(hook): emit Cursor JSON on early exits - #5373
sanketpatel32 wants to merge 4 commits into
Conversation
|
|
Kernel-Hunter
left a comment
There was a problem hiding this comment.
Checked out the branch and ran bash hooks/cursor/test-rtk-rewrite.sh: all 6 cases pass. I also pointed the same script at the current rtk-rewrite.sh from the base branch through HOOK=, and 5 of the 6 fail there (the three dependency/version exits plus empty command and no rewrite), so the test does catch the missing {}.
I went through every exit 0 in the hook. All 6 now print {} first, and the only other path is the final jq -n rewrite output, so no exit is left without JSON.
One note: the new script isn't referenced from any workflow, so CI won't run it. hooks/claude/test-rtk-rewrite.sh is in the same state, so this matches the existing pattern, but it might be worth wiring both in later.
Summary
{}on the Cursor hook's jq-missing, rtk-missing, and too-old exits while keeping the existing stderr warnings.Fixes #5323
Test plan
bash hooks/cursor/test-rtk-rewrite.sh(6 tests passed)shellcheck hooks/cursor/rtk-rewrite.sh hooks/cursor/test-rtk-rewrite.shcargo fmt --all --checkcargo clippy --all-targetscargo test --allbash scripts/check-test-presence.sh origin/develop