Skip to content
koalaman edited this page Nov 4, 2017 · 1 revision

Place shellcheck directives before commands, not after.

Problematic code:

var=1 # shellcheck disable=SC2034

Correct code:

# shellcheck disable=SC2034
var=1 

Rationale:

ShellCheck expects directives to come before the relevant command. They are not allowed after.

Exceptions:

If this is not a directive and just a comment mentioning ShellCheck, please rewrite or capitalize:

var=1 # ShellCheck encourages lowercase variable names

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally