From fb74770abb082dba1adc0619ae911bb8fe7dd462 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 9 Apr 2021 18:15:48 +0000 Subject: [PATCH] shellcheck add more detail to README.md --- shellcheck/README.md | 49 ++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 13 deletions(-) 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: + -- 2.25.1