From cbe492cbb817fec51b3409c5194700a81b473817 Mon Sep 17 00:00:00 2001 From: Edward Knight Date: Thu, 11 Jun 2020 18:42:11 +0100 Subject: [PATCH] Used the wiki template and added examples from #1979 --- SC1125.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/SC1125.md b/SC1125.md index 292e083..0be4b3f 100644 --- a/SC1125.md +++ b/SC1125.md @@ -1 +1,20 @@ -See [the Directive page](Directive) about how to properly [format a shellcheck directive](Directive#documenting-directive-use). \ No newline at end of file +## Invalid key=value pair in directive + +### Problematic code: + +```sh +# shellcheck disable=SC2153 (variable not a misspelling) +``` + +### Correct code: + +```sh +# shellcheck disable=SC2153 # variable not a misspelling +``` + +### Rationale: + +A comment at the end of a directive must be preceded by a `#` +to avoid it being interpreted as an instruction. +The [directive page](Directive#documenting-directive-use) +contains more guidance about commenting style. \ No newline at end of file