-
Notifications
You must be signed in to change notification settings - Fork 797
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
Shellcheck #223
Merged
Merged
Shellcheck #223
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bf60c7f
Add lint script and run as part of CI tests
jonknapp 808a8d4
Fix many shellcheck issues; ignore a few others
jonknapp 9a3bd01
Ignore following non-constant source
jonknapp 7751fd4
Add TravisCI instructions for osx setup of shellcheck
jonknapp 91d52b9
Run shellcheck on lib/utils.sh
jonknapp f75e988
Fix another linter error that did not trigger on osx
jonknapp 9d6ddb7
Fix linter errors
jonknapp e814d58
Shellcheck all commands
vic 8b40b30
let bin/asdf expand args into command functions
vic 33d7d9c
Merge remote-tracking branch 'source/master' into origin/shellcheck
jonknapp 32b2690
Fix incorrect linter error from help text parsing
jonknapp 20b70bc
Remove shebangs from lib files and pass bash dialect to shellcheck
jonknapp 85550c8
Remove extra, unnecessary quoting
jonknapp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
language: c | ||
script: bats test | ||
|
||
script: | ||
- bats test | ||
- ./lint.sh | ||
|
||
before_install: | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install shellcheck; fi | ||
|
||
before_script: | ||
- git clone https://github.com/sstephenson/bats.git /tmp/bats | ||
- export PATH=/tmp/bats/bin:$PATH | ||
|
||
os: | ||
- linux | ||
- osx |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
help_command () { | ||
echo "version: $(asdf_version)" | ||
echo "" | ||
cat $(asdf_dir)/help.txt | ||
cat "$(asdf_dir)/help.txt" | ||
} |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the
echo
s may still be needed here if something is capturing the output from this function.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super well versed in bash scripting, so please feel free to let me know if something I suggest is incorrect. That said, I'm not sure why the
echo
is needed if the output of thegrep
command is sent to stdout/err already. It was a recommendation fromshellcheck
which may or may not apply here.For the rest of comments, feel free to run this with shellcheck yourself to see the error output. I put a
lint.sh
file in the root of the project that lints the project files.