From 25eb10fe39b81958344b1e56d488bf0c3db3f717 Mon Sep 17 00:00:00 2001 From: MechaLynx Date: Sat, 28 Oct 2017 05:26:22 +0300 Subject: [PATCH] Added warning for #1036 --- Directive.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Directive.md b/Directive.md index 5a41628..da3742a 100644 --- a/Directive.md +++ b/Directive.md @@ -22,6 +22,8 @@ Supported directives are `disable` to disable warnings: Directives instead of or immediately after the shebang apply to the entire script. Otherwise, they are scoped to the structure that follows it (such as all branches of a `case` statement, or an entire function). +*Note: There is a [known bug](../../issues/1036) in the current version when directives appear within `then` clauses of `if` blocks that causes Shellcheck to report 1072 on otherwise valid code. Avoid using directives within `then` clauses - instead place them at the top of the `if` block or another enclosing block.* + There is no support for scoping a directive to the first structure of the script. In these cases, use a dummy command `true` or `:` and then add directives, such as # This directive applies to the entire script