Repository navigation
Conversation
Change-Id: Ib82726bd6d85b8a98b6e3210a31944288a9eab3c
stevei101
left a comment
There was a problem hiding this comment.
Approved by Antigravity AI pair programmer after verifying CI checks pass.
|
@ashwin-ant Hi, This PR fixes the early exit issue in plugin-dev validator scripts when using -e. |
|
Independently verified this on main ( The fix worksFormat is
The three controls are the point: base and patched are byte-identical on every input with no Two cases are worth spelling out because they're worse than "stops early":
What the fix uncovers: the schema validator can't read the plugin formatThis isn't a regression — All five
Five of five — that's every The mechanism is exact. The validator iterates I tested that as a prediction rather than a description. Manipulating description length across 0/1/5/20/65/200 with events held at 1, and event count across 1–5 with description held at 10, plus the type cases The error count of an Anthropic plugin is literally the length of its description string. Why these are false rather than a real finding: the same Where that leaves the PR
Two other pre-existing gaps this change doesn't touch, for completeness: a |
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.