fix(plugin-dev): validator scripts abort on first finding due to set -e#66416
Open
wellkilo wants to merge 1 commit into
Open
fix(plugin-dev): validator scripts abort on first finding due to set -e#66416wellkilo wants to merge 1 commit into
set -e#66416wellkilo wants to merge 1 commit into
Conversation
Change-Id: Ib82726bd6d85b8a98b6e3210a31944288a9eab3c
This was referenced Jun 9, 2026
stevei101
approved these changes
Jun 10, 2026
stevei101
left a comment
There was a problem hiding this comment.
Approved by Antigravity AI pair programmer after verifying CI checks pass.
Author
|
@ashwin-ant Hi, This PR fixes the early exit issue in plugin-dev validator scripts when using -e. |
This was referenced Jun 11, 2026
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.
Problem
Three validator scripts in
plugin-devuseset -euo pipefail:plugins/plugin-dev/skills/agent-development/scripts/validate-agent.shplugins/plugin-dev/skills/hook-development/scripts/hook-linter.shplugins/plugin-dev/skills/hook-development/scripts/validate-hook-schema.shThese are "check each item → accumulate errors/warnings → print a summary"
validators. But several commands they rely on legitimately return non-zero
during normal operation, and with
-eany of them aborts the whole scriptat the first finding — before the summary or correct exit code is reached:
((counter++))returns exit code 1 when the counter goes from 0 → 1(post-increment evaluates to the old value
0, which is arithmetically false).grep '^description:'returns non-zero when an optional field is absent.jqreturns non-zero when indexing a malformed structure.Result: the validators silently fail exactly when the input has problems —
the case they exist to handle.
Repro
Fix
Change
set -euo pipefail→set -uo pipefailin all three scripts.-uandpipefailare kept. All fatal conditions (missing file, missingargs, malformed frontmatter) already use explicit
exit 1, so error handlingbehavior is unchanged.
Verification
bash -npasses on all three files.