Simplify shellcheck discovery to .sh only (review feedback from #6) - #7
Merged
Conversation
Per review feedback on #6: this repo's convention is that all shell scripts are named *.sh, so the multi-extension globs and the shebang scan are unnecessary. Drops the bash-specific `mapfile` + read loop in favor of `git ls-files '*.sh' | xargs -0 -r shellcheck`, which is shorter, POSIX-friendly, and still picks up scripts in any directory on the PR that adds or renames them. Resolves: #6 (comment)
dolph
commented
Apr 26, 2026
dolph
commented
Apr 26, 2026
This was referenced Apr 27, 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.
Summary
Addresses the review comment on #6 (#6 (comment)):
Drops the multi-extension glob (
*.bash,*.ksh,*.zsh) and the shebang-scan fallback. Replaces the bash-specificmapfile+ read loop with a one-liner:git ls-files '*.sh' | xargs -0 -r shellcheck. The-r(no-run-if-empty) flag handles the empty case without an explicit guard.The behavior the previous version was designed to preserve is unchanged: scripts in any subdirectory are still picked up, and newly added or renamed
.shfiles are linted automatically on the PR that introduces them — that property comes fromgit ls-files, not from the extension list.Diff
Net
-23 +6lines.Test plan
build.shandinstall.sh,shellcheckexits 0.shellcheckstep passing.https://claude.ai/code/session_013HnepY8MhhxrJJjE5ysW47
Generated by Claude Code