Skip to content

Files

Latest commit

 

History

History
29 lines (18 loc) · 588 Bytes

SC1126.md

File metadata and controls

29 lines (18 loc) · 588 Bytes

Pattern: Misplaced shellcheck directive

Issue: -

Description

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

Example of incorrect code:

var=1 # shellcheck disable=SC2034

Example of correct code:

# shellcheck disable=SC2034
var=1 

Exceptions

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

var=1 # ShellCheck encourages lowercase variable names

Further Reading