fix(plugin-dev): report missing jq dependency - #83990
Open
RerankerGuo wants to merge 1 commit into
Open
Conversation
Check for jq before validating hook test input so a missing binary is not misreported as invalid JSON.\n\nRefs anthropics#83802
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #83802.
test-hook.shpreviously treated every failure fromjq emptyas invalid JSON. Whenjqwas not installed, the shell error was suppressed and valid input was reported as malformed.This change checks for
jqbefore its first use and reports the missing dependency with an installation link.Verification
PATHthat does not containjq: the script reportedTest input is not valid JSON.jq is required but not installedand exits with status 1.jqavailable and a successful hook: the script exits with status 0.bash -n plugins/plugin-dev/skills/hook-development/scripts/test-hook.sh.git diff --check.Scope
This PR only improves dependency diagnosis. It does not change JSON validation or hook result semantics, and it does not address platform availability of the separate
timeoutcommand.