-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GitHub Actions with ShellCheck #951
Open
asbjornu
wants to merge
19
commits into
mathiasbynens:main
Choose a base branch
from
asbjornu:feature/shellcheck
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Fix SC2197: fgrep is non-standard and deprecated. Use grep -F instead. https://www.shellcheck.net/wiki/SC2197
Fix SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. https://www.shellcheck.net/wiki/SC2164
Fix SC2128: Expanding an array without an index only gives the first element. https://www.shellcheck.net/wiki/SC2128
Ignore SC1090: ShellCheck can't follow non-constant source. Use a directive to specify location. https://www.shellcheck.net/wiki/SC1090 See the following discussion for why SC1090 is disabled and not fixed: koalaman/shellcheck#507
Fix SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. https://www.shellcheck.net/wiki/SC2166
Fix SC2162: read without -r will mangle backslashes. https://www.shellcheck.net/wiki/SC2162
Fix SC2091: Remove surrounding $() to avoid executing output (or use eval if intentional). https://www.shellcheck.net/wiki/SC2091
Ignore SC2034: foo appears unused. Verify use (or export if used externally). https://www.shellcheck.net/wiki/SC2034
Ignore SC2154: yellow is referenced but not assigned. https://www.shellcheck.net/wiki/SC2154
Fix SC2155: Declare and assign separately to avoid masking return values. https://www.shellcheck.net/wiki/SC2155
Fix SC1018: This is a unicode non-breaking space. Delete and retype it. https://www.shellcheck.net/wiki/SC1018
Fix SC2124: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. https://www.shellcheck.net/wiki/SC2124
Fix SC2199: Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @). https://www.shellcheck.net/wiki/SC2199
Fix SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. https://www.shellcheck.net/wiki/SC2181
Fix SC2046: Quote this to prevent word splitting. https://www.shellcheck.net/wiki/SC2046
Ignore SC2139: This expands when defined, not when used. Consider escaping. https://www.shellcheck.net/wiki/SC2139
Fix SC2140: Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"? https://www.shellcheck.net/wiki/SC2140
Okeanos
added a commit
to Okeanos/dotfiles
that referenced
this pull request
Nov 28, 2021
See mathiasbynens#951 for details
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.
This PR adds a GitHub Action workflow with
bewuethr/shellcheck-action
to execute ShellCheck against all shell scripts in the repository. A Dependabot config file to keep the GitHub Actions workflow up to date is also added and all the ShellCheck errors are fixed or ignored as appropriate.