You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an optional rule, which means that it has a special "long name" and is not enabled by default. See the optional page for more details. In short, you have to enable it with the long name instead of the "SC" code like you would with a normal rule:
.shellcheckrc
enable=require-double-brackets # SC2292
Problematic code:
[ -e /etc/issue ]
Correct code:
[[ -e /etc/issue ]]
Rationale:
ShellCheck has been explicitly asked to warn about uses of [ .. ] in favor of the extended Bash/Ksh test [[ .. ]].
[[ .. ]] suppresses word splitting and globbing, supports a wider variety of tests, and is generally safer and better defined than [ .. ]. For an in-depth list of differences, see the Related Resources.
Exceptions:
This check is not enabled by default, and may have been turned on for your current project by someone who wants it enforced. You can still ignore it with a directive.
This suggestion does not trigger for Sh or Dash scripts, even when explicitly enabled, as these shells don't support [[ .. ]].