Skip to content

fix(lint): replace stale hook-extension template with canonical version - #119

Merged
twistedmelonman merged 1 commit into
mainfrom
claude/wave3-shellcheck-4b6b87fc
Sep 10, 2026
Merged

twistedmelonman merged 1 commit into
mainfrom
claude/wave3-shellcheck-4b6b87fc

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

What this fixes

.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 was the only failing file in this repo and accounted for all 13 shellcheck findings — the sole reason standards-check failed.

The file is replaced verbatim with the fleet-canonical version (sha256 d3b8d301ace5…), the same content already merged into spokane-snow, dumbify, and personify.

What was wrong

Finding Fix
SC2155 (x6) local var=$(cmd) masks the command's exit status. Split into a bare local declaration followed by assignment.
Quoting / SC2312 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 TODO 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.

Behavior is unchanged. An unmodified copy of this file still runs no checks — the ENABLE_* gates all default to 0, 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-check run. 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 fake HOME= does not prevent this — the checkout must physically live outside $HOME).

  • Before the fix: exit 1 — 13 findings, all in this one file, shellcheck the only failing linter.
  • After the fix: exit 0 — clean.

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

.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
@claude

claude Bot commented Sep 10, 2026

Copy link
Copy Markdown

All changes are confined to .claude/hooks/extensions/example.sh.disabled, a template file that runs no checks by default. The changes fix shellcheck findings (local var=$(cmd) two-line split), replace a non-POSIX negative lookahead in grep with a portable grep -v pipeline, and replace the commented-out check list with ENABLE_*=0 guards. No production code paths are affected.

VERDICT: PASS

@twistedmelonman
twistedmelonman merged commit cb9776d into main Sep 10, 2026
4 checks passed
@twistedmelonman
twistedmelonman deleted the claude/wave3-shellcheck-4b6b87fc branch September 10, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant