fix(lint): replace stale hook-extension template with canonical version - #119
Merged
Merged
Conversation
.claude/hooks/extensions/example.sh.disabled was a stale copy of the
fleet-wide hook-extension template, predating the shellcheck fixes already
applied upstream. It produced all 13 shellcheck findings in this repo and was
the sole reason standards-check failed:
- SC2155 (x6): `local var=$(cmd)` masks the command's return value; split
into a bare `local` declaration followed by assignment.
- SC2312 / quoting: the hardcoded-secret regexes used `\x27` escapes inside
single quotes, which bash does not interpret; rewritten as double-quoted
patterns containing literal quote characters.
- grep lookahead: `TODO(?! #[0-9])` is PCRE syntax that `grep -E` does not
support, so the check never matched as intended. Replaced with a
match-then-exclude pipeline.
- SC2329 (x5): every check function was unreachable because all calls in
main() were commented out. Calls are now real, each gated behind an
ENABLE_* variable defaulting to 0, so the file's behavior is unchanged
(no checks run in an unmodified copy) while the functions are reachable.
Copied verbatim from the fleet-canonical template
(sha256 d3b8d301ace5...), the same content already merged into spokane-snow,
dumbify, and personify.
Verified with the standards harness run from outside $HOME (so shellcheck
cannot pick up ~/.shellcheckrc): exit 1 before, exit 0 after. A deliberate
fault injected into this file was caught by path, confirming the clean result
reflects a real scan rather than a skipped file.
Claude-Session: https://claude.ai/code/session_01XTyHGrxSHqhck86SvGDn7o
|
All changes are confined to VERDICT: PASS |
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.
What this fixes
.claude/hooks/extensions/example.sh.disabledwas a stale copy of the fleet-wide hook-extension template, predating the shellcheck fixes already applied upstream. It was the only failing file in this repo and accounted for all 13 shellcheck findings — the sole reasonstandards-checkfailed.The file is replaced verbatim with the fleet-canonical version (sha256
d3b8d301ace5…), the same content already merged intospokane-snow,dumbify, andpersonify.What was wrong
local var=$(cmd)masks the command's exit status. Split into a barelocaldeclaration followed by assignment.\x27escapes inside single quotes, which bash does not interpret. Rewritten as double-quoted patterns containing literal quote characters.TODO(?! #[0-9])is PCRE syntax thatgrep -Edoes not support, so the TODO check never matched as intended. Replaced with a match-then-exclude pipeline.main()were commented out. Calls are now real, each gated behind anENABLE_*variable defaulting to0.Behavior is unchanged. An unmodified copy of this file still runs no checks — the
ENABLE_*gates all default to0, replacing the old commented-out calls. The difference is that the functions are now reachable, so shellcheck can see them and a user enables a check by setting a variable rather than by editing out a comment.Why it matters
This gives the repo its first-ever
standards-checkrun. The caller stub landed in d4ce5f0 as a non-required status; with this fix the check is green and the repo becomes eligible to make it required.Verification
The standards harness was run from a checkout outside
$HOME, so shellcheck cannot walk up and pick up~/.shellcheckrc(a fakeHOME=does not prevent this — the checkout must physically live outside$HOME).Because a silent pass and a skipped file look identical in the output, a deliberate fault was injected into this exact file and re-scanned: shellcheck flagged it by path, confirming the clean result reflects a real scan rather than a skipped file. The fault was then removed and the file re-verified byte-identical to canonical.
https://claude.ai/code/session_01XTyHGrxSHqhck86SvGDn7o