Consider adding a linter / some static analysis
Closed this issue · 2 comments
dwijnand commented
Here's a collection of useful resources I've held on to for this:
- https://github.com/koalaman/shellcheck
- http://redsymbol.net/articles/unofficial-bash-strict-mode/
- http://blog.pangyanhan.com/posts/2015-12-25-on-the-unofficial-bash-strict-mode-by-aaron-maxwell.html
These would also have to be wired into Travis.
dwijnand commented
ghcup runs shellcheck like so:
edo()
{
printf "\\033[0;34m%s\\033[0m\\n" "$*" 1>&2
"$@" || exit 2
}
# install shellcheck
edo wget https://storage.googleapis.com/shellcheck/shellcheck-latest.linux.x86_64.tar.xz
edo tar -xJf shellcheck-latest.linux.x86_64.tar.xz
edo mv shellcheck-latest/shellcheck "$HOME"/.local/bin/shellcheck
# check our script for errors
edo shellcheck ghcup