mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created Directive (markdown)
14
Directive.md
Normal file
14
Directive.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
Shellcheck directives allows selectively silencing warnings, and takes the form of comments in files:
|
||||||
|
|
||||||
|
hexToAscii() {
|
||||||
|
# shellcheck disable=SC2059
|
||||||
|
printf "\x$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
The only supported directive is `disable`:
|
||||||
|
|
||||||
|
# shellcheck disable=code[,code...]
|
||||||
|
|
||||||
|
Directives are scoped to the structure that follows it. For example, before a function it silences all warnings in the function. Before a case statement, it silences all warnings.
|
||||||
|
|
||||||
|
Silencing parser errors is purely cosmetic, and will not make ShellCheck continue.
|
Reference in New Issue
Block a user