mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
add another possible cause of error
16
SC1072.md
16
SC1072.md
@@ -3,3 +3,19 @@
|
|||||||
*Note: There is a [known bug](../issues/1036) in the current version when [directives](../wiki/Directive) appear within `then` clauses of `if` blocks that causes Shellcheck to report SC1072 on otherwise valid code. Avoid using directives within `then` clauses - instead place them at the top of the `if` block or another enclosing block. This is fixed on the [online version](https://www.shellcheck.net/) and the next release.*
|
*Note: There is a [known bug](../issues/1036) in the current version when [directives](../wiki/Directive) appear within `then` clauses of `if` blocks that causes Shellcheck to report SC1072 on otherwise valid code. Avoid using directives within `then` clauses - instead place them at the top of the `if` block or another enclosing block. This is fixed on the [online version](https://www.shellcheck.net/) and the next release.*
|
||||||
|
|
||||||
See [Parser Error](https://github.com/koalaman/shellcheck/wiki/Parser-Error).
|
See [Parser Error](https://github.com/koalaman/shellcheck/wiki/Parser-Error).
|
||||||
|
|
||||||
|
This error can also occur with an [incomplete shellcheck directive](https://github.com/koalaman/shellcheck/wiki/Ignore/ceb874a8defc0df77b285e4fc54f897ed9dbb231#ignoring-all-errors-in-a-file-08) like `# shellcheck disable` instead of `# shellcheck disable=all`
|
||||||
|
|
||||||
|
### Problematic code
|
||||||
|
```sh
|
||||||
|
# shellcheck disable
|
||||||
|
echo stuff that shellcheck up to at least v0.10.0 will not even see because of the incorrect directive above
|
||||||
|
```
|
||||||
|
|
||||||
|
### Correct code
|
||||||
|
```sh
|
||||||
|
# shellcheck disable=all
|
||||||
|
echo stuff that shellcheck will correctly ignore entirely
|
||||||
|
```
|
||||||
|
|
||||||
|
###
|
Reference in New Issue
Block a user