4 ms·
Directives apply line by line. The only ones that apply to a bigger scope are mandated to be the next line right after shebang and apply to the whole file. htt
by lloeki 3y ago
Directives apply line by line. The only ones that apply to a bigger scope are mandated to be the next line right after shebang and apply to the whole file.
https://github.com/koalaman/shellcheck/wiki/Directive https://github.com/koalaman/shellcheck/wiki/Directive
> Directives that replace or are immediately after the shebang apply to the entire script. Otherwise, they are scoped to the command that follows it
https://github.com/koalaman/shellcheck/wiki/Ignore https://github.com/koalaman/shellcheck/wiki/Ignore
> Note that the directive must be on the first line after the shebang with versions before 0.4.6. As of 0.4.6 comments and whitespace are allowed before file-wide directives.
- lloeki 3y agoThere's an issue already about it: https://github.com/koalaman/shellcheck/issues/760 https://github.com/koalaman/shellcheck/issues/760