X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=shellcheck%2FREADME.md;h=8733f63ad498317818a2c47aafff315cf2bfee76;hb=fb74770abb082dba1adc0619ae911bb8fe7dd462;hp=98e2d17048913e055779b7f9e8484d31c524ee11;hpb=0097af733aea49998df61c51d0be37a6d14289ae;p=webi-installers%2F.git 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: +