ci: add shellcheck to pre-commit and fix existing warnings#1681
Open
ralphbean wants to merge 1 commit into
Open
ci: add shellcheck to pre-commit and fix existing warnings#1681ralphbean wants to merge 1 commit into
ralphbean wants to merge 1 commit into
Conversation
Add shellcheck-py hook to pre-commit so all shell scripts are checked on every commit and in CI. Fix existing warnings: - SC2034: remove unused variable, rename to _ prefix - SC2188: use `: >` instead of bare `> file` for truncation - SC2002: replace useless cat with direct file arg - SC2129: group repeated appends into a single redirect block Globally suppress SC1091 (unresolvable dynamic source paths), SC2001 (sed backreferences that bash substitution cannot express), and SC2016 (intentional single-quoted GraphQL $variables). Assisted-by: Claude claude-opus-4-6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
Site previewPreview: https://164e536e-site.fullsend-ai.workers.dev Commit: |
ReviewFindingsHigh
NotesThe shellcheck fixes across all 7 files are correct and behavioral-preserving:
The globally suppressed shellcheck codes are reasonable:
|
| hooks: | ||
| - id: gitleaks | ||
|
|
||
| - repo: https://github.com/shellcheck-py/shellcheck-py |
There was a problem hiding this comment.
[high] protected-path
This PR modifies a protected infrastructure file (.pre-commit-config.yaml) without a linked issue providing authorization for the change. The modification itself is sound (adding shellcheck-py as a pre-commit hook), but human approval is required for all protected-path changes. Consider linking a tracking issue to this PR.
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
shellcheck-pypre-commit hook so all shell scripts are linted on every commit and in CI (no extra install step needed — the hook bundles its own binary)sourcepaths), SC2001 (sed backrefs), SC2016 (intentional single-quoted$varsin GraphQL)Test plan
pre-commit run shellcheck --all-filespasses cleanmake script-testpasses — no regressions from the fixes🤖 Generated with Claude Code