fix: resolve shellcheck warnings in test and packaging scripts#518
Merged
fix: resolve shellcheck warnings in test and packaging scripts#518
Conversation
- Add missing shebang to doinst.sh (SC2148) - Quote variables throughout to prevent word splitting/globbing (SC2086) - Replace echo "\n" with printf for escape sequences (SC2028) - Replace backticks with $() (SC2006) - Replace expr with $(()) arithmetic (SC2003) - Replace [ ! $(grep ...) ] with ! grep -q (SC2143) - Replace ls | wc -l with find | wc -l (SC2012) - Replace printf "---\n" with echo for plain separator lines (SC3045) All scripts remain POSIX/dash compatible. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Quote $(id -u) to prevent word splitting (SC2046) - Replace [ -n "$(mount | grep ...)" ] with mount | grep -q (SC2143) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add shell directive to COMMON (SC2148) - Quote variables, fix backticks/expr, fix -o in [ ] (SC2086/SC2006/SC2003/SC2166) - Fix pattern expansion quoting in cmp_substr (SC2295) - Quote basename argument (SC2086) - Fix broken echo strings in error message - Remove unused TESTS_DIR variable - Add SC2034 disable comments for variables used by sourcing scripts - Update SHELLCHECK_OPTS path to test/ so shellcheck can follow COMMON source Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SHELLCHECK_OPTS used $GITHUB_WORKSPACE which GitHub Actions does not expand in env: blocks. SCRIPTDIR is shellcheck's built-in token that resolves to the directory of the script being checked, so shellcheck can find COMMON alongside each test script without a hardcoded path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The OpenSUSE Tumbleweed CI container does not have 'find' in PATH. Revert to the original ls -A approach and suppress SC2012 since filenames in the waste folder are controlled and the count is reliable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
All scripts remain POSIX/dash compatible.