ShellCheck¶
ShellCheck is a GPLv3 tool that gives warnings and suggestions for bash/sh shell scripts
https://www.shellcheck.net/
Enabling ShellCheck¶
To enable ShellCheck for your repository, simply add the following lines to your configuration:
build:
nodes:
analysis:
tests:
override:
- shellcheck-run
shellcheck-run
is a built-in wrapper for ShellCheck which takes care of results and output format.
Analyzed Files¶
The command always analyzes all shell files in the current directory which have a hashbang #!
that
matches bash
, sh
, ksh
, or dash
.
If you only would like to analyze the files in a specific path, you can first switch to that path before
invoking shellcheck-run
:
build:
nodes:
analysis:
tests:
override:
- cd bin/scripts
- shellcheck-run