mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Used the wiki template and added examples from #1979
21
SC1125.md
21
SC1125.md
@@ -1 +1,20 @@
|
||||
See [the Directive page](Directive) about how to properly [format a shellcheck directive](Directive#documenting-directive-use).
|
||||
## 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.
|
Reference in New Issue
Block a user