ShellCheck directive
A comment such as # shellcheck disable=SC2086 that tells ShellCheck to skip one finding on the next line.
In more detail
Use it only when the code is deliberately doing what ShellCheck warns about, and write the reason on the same line. Disabling a whole file hides real bugs later.
Example
# shellcheck disable=SC2086 # flags must split into two optionsRelated terms
- ShellCheck — A linter for shell scripts that reports quoting mistakes, portability problems and common bugs, each with a numbered code.
- SC2086 — The ShellCheck warning for an unquoted variable expansion, which may be split into several words or expanded as a glob.
Taught in
- ShellCheck — Bash Scripting & Command Line Automation
- eval, And What To Use Instead — Bash Scripting & Command Line Automation