Skip to content

Compare: Directive

New page
Showing with 357 additions and 153 deletions.
  1. +1 −1 DevGuide.md
  2. +22 −2 Directive.md
  3. +13 −0 GitLab-CI.md
  4. +5 −0 Ignore.md
  5. +10 −10 Recursiveness.md
  6. +1 −0 SC1027.md
  7. +4 −1 SC1036.md
  8. +9 −0 SC1070.md
  9. +5 −2 SC1088.md
  10. +1 −1 SC1102.md
  11. +11 −0 SC2000.md
  12. +1 −1 SC2009.md
  13. +23 −0 SC2011.md
  14. +12 −6 SC2012.md
  15. +2 −1 SC2045.md
  16. +7 −16 SC2046.md
  17. +5 −5 SC2095.md
  18. +10 −0 SC2124.md
  19. +19 −6 SC2126.md
  20. +20 −2 SC2128.md
  21. +10 −4 SC2148.md
  22. +1 −1 SC2154.md
  23. +14 −1 SC2155.md
  24. +31 −0 SC2178.md
  25. +1 −1 SC2192.md
  26. +4 −8 SC2206.md
  27. +1 −1 SC2207.md
  28. +18 −5 SC2230.md
  29. +3 −1 SC2248.md
  30. +26 −0 SC2250.md
  31. +29 −0 SC2256.md
  32. +38 −0 SC2257.md
  33. +0 −1 _Sidebar.md
  34. +0 −76 javascript.textile
24 changes: 22 additions & 2 deletions Directive.md
Expand Up @@ -7,7 +7,7 @@ hexToAscii() {
}
```

Supported directives are
## Supported directives

### disable
Prevent shellcheck from processing one or more warnings:
Expand Down Expand Up @@ -66,4 +66,24 @@ f() {
}
```

Silencing parser errors is purely cosmetic; any parser error found will still stop ShellCheck at the point of the error.
Silencing parser errors is purely cosmetic; any parser error found will still stop ShellCheck at the point of the error.

## Documenting directive use

To document why a specific directive was used, it is recommended to add a comment.

The comment can be added on the preceding line. This is the recommended option for long comments.

```sh
# this is intentional because of reasons
# that are long and need explaining
# shellcheck disable=SC1234
statement_where_warning_should_be_disabled
```

The comment can also be added at the end of the directive line. This is the recommended option for short comments.

```sh
# shellcheck disable=SC1234 # this is intentional
statement_where_warning_should_be_disabled
```