Skip to content

fix(shellcheck): resolve the lint config the way CI does - #353

Merged
twistedmelonman merged 2 commits into
mainfrom
claude/fix-shellcheck-config-gate-592c2a44
Sep 19, 2026
Merged

twistedmelonman merged 2 commits into
mainfrom
claude/fix-shellcheck-config-gate-592c2a44

Conversation

@twistedmelonman

Copy link
Copy Markdown
Owner

The pre-commit shell hook ran shellcheck with no --rcfile, so shellcheck fell
back to its ancestor search. That search reaches $HOME and picked up
~/.shellcheckrc (enable=all), which CI never sees.

Measured over dotfiles' 60 tracked shell files at -S info:

config findings
repo .shellcheckrc 0
canonical base 0
~/.shellcheckrc (enable=all) 87

Adds lint-shellcheck.sh, which resolves the repo-root .shellcheckrc if there
is one and the canonical base otherwise, and passes it explicitly. Vendors that
base byte-identical from github-workflows/standards/shellcheckrc.

enable=all stays in ~/.shellcheckrc as the stricter interactive config. It
is deliberately not in the base: a base that forces per-repo exceptions is not a
base.

Full suite green: 335 assertions, 0 failures.

Advances twistedmelonman/claude-config#534 — this is what unblocks step 3, the
per-repo .shellcheckrc deletions, which would otherwise drop every local run
onto those 87 findings.

https://claude.ai/code/session_011awg91UvzUos9YoXHJ2e8B

Claude Code Bot added 2 commits September 18, 2026 16:31
lint-shell.sh passed no --rcfile, so shellcheck used its ancestor search, which
reaches $HOME. Measured over 60 shell files at -S info: repo rc and canonical
base both 0 findings, ~/.shellcheckrc (enable=all) 87.

Adds lint-shellcheck.sh to resolve repo-root .shellcheckrc else the canonical
base, and vendors that base from github-workflows/standards.

Unblocks the per-repo .shellcheckrc deletions in claude-config#534, which would
otherwise drop every local run onto ~/.shellcheckrc.

Advances twistedmelonman/claude-config#534
lint-shell.sh calls lint-shellcheck.sh, a sibling symlink install.sh creates.
A machine that pulls the previous commit without re-running install.sh does not
have it, and under set -e that exits 127 and blocks every commit touching a
shell file.

Degrade to shellcheck's own discovery and say why.
@claude

claude Bot commented Sep 19, 2026

Copy link
Copy Markdown
No blocking issues. The PR resolves shellcheck config lookup to avoid picking up ~/.shellcheckrc (enable=all) that CI never sees, ships a canonical config, and handles fresh-machine degradation gracefully. VERDICT: PASS

@claude

claude Bot commented Sep 19, 2026

Copy link
Copy Markdown

VERDICT: PASS

@claude

claude Bot commented Sep 19, 2026

Copy link
Copy Markdown

Configuration resolution for shellcheck added to pre-commit hook with graceful degradation. Code handles all failure paths (missing resolver, empty config, missing canonical config) by falling back to shellcheck's default discovery and printing diagnostic messages.

Array expansion ("${shellcheck_rc[@]}") is correct bash syntax for both empty and populated arrays. All shellcheck invocations protected by || true.

VERDICT: PASS

@twistedmelonman
twistedmelonman merged commit 1772bb8 into main Sep 19, 2026
5 checks passed
@twistedmelonman
twistedmelonman deleted the claude/fix-shellcheck-config-gate-592c2a44 branch September 19, 2026 00:08
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