From: AJ ONeal Date: Fri, 9 Apr 2021 18:15:48 +0000 (+0000) Subject: shellcheck add more detail to README.md X-Git-Url: https://git.josue.xyz/?p=webi-installers%2F.git;a=commitdiff_plain;h=fb74770abb082dba1adc0619ae911bb8fe7dd462 shellcheck add more detail to README.md --- diff --git a/shellcheck/README.md b/shellcheck/README.md index 98e2d17..8733f63 100644 --- a/shellcheck/README.md +++ b/shellcheck/README.md @@ -12,30 +12,53 @@ specific version. > shellcheck catches rookie mistakes (and old-habits-die-hard mistakes) in bash -### Run shellcheck in your terminal: +Also recommended by Google's +[Shell Style Guide](https://google.github.io/styleguide/shellguide.html) + +### How to run shellcheck from the CLI ```bash -shellcheck yourscript +shellcheck ./script.sh ``` - +See +[Visual Studio Marketplace: ShellCheck](https://marketplace.visualstudio.com/items?itemName=timonwong.shellcheck). ### To use shellcheck in a build or test suite: Simply include shellcheck in the process. -```bash +```yaml check-scripts: - # Fail if any of these files have warnings - shellcheck myscripts/*.sh + # Fail if any of these files have warnings + shellcheck myscripts/*.sh +``` + +### How to ignore an error + +You can ignore an error by putting a comment with the `SCXXXX` error code above +it: + +```bash +# shellcheck disable= +``` + +```bash +# shellcheck disable=SC1004 +NOT_AN_ERROR='Look, a literal \ +inside of a string!' ``` - +Complete list of `SCXXXX` error codes: +