When specifying disable=foo (or any invalid value), shellcheck says Expected '=' after directive key which is very confusing since '=' is present and after the directive key.
For bugs with existing features
Here's a snippet that shows the problem & Here's what shellcheck currently says:
When in # shellcheck directive:
$ shellcheck -s sh <(echo '# shellcheck disable=foo')
In /dev/fd/63 line 1:
# shellcheck disable=foo
^-- SC1073 (error): Couldn't parse this shellcheck directive. Fix to allow more checks.
^-- SC1072 (error): Expected '=' after directive key. Fix any mentioned problems and try again.
For more information:
https://www.shellcheck.net/wiki/SC1072 -- Expected '=' after directive key....
https://www.shellcheck.net/wiki/SC1073 -- Couldn't parse this shellcheck di...
When in shellcheckrc:
$ shellcheck -s sh --rcfile <(echo 'disable=foo') /dev/null
In /dev/null line 1:
^-- SC1134 (error): Failed to process /dev/fd/63, line 1: Expected '=' after directive key. Fix any mentioned problems and try again.
For more information:
https://www.shellcheck.net/wiki/SC1134 -- Failed to process /dev/fd/63, lin...
Here's what I wanted or expected to see:
Ideal: "foo-bar" is not a valid value for the "disable" directive, must be "all" or in the format SCxxxx, where xxxx is a shellcheck error code like 2086
Also good: "foo-bar" is not a valid value for the "disable" directive, or even just invalid directive
When specifying
disable=foo(or any invalid value), shellcheck saysExpected '=' after directive keywhich is very confusing since '=' is present and after the directive key.For bugs with existing features
shellcheck --versionor "online"): Tried on both 0.11.0 and master as of 2026-03-22 (cd41f79)Here's a snippet that shows the problem & Here's what shellcheck currently says:
When in
# shellcheckdirective:When in shellcheckrc:
Here's what I wanted or expected to see:
Ideal:
"foo-bar" is not a valid value for the "disable" directive, must be "all" or in the format SCxxxx, where xxxx is a shellcheck error code like 2086Also good:
"foo-bar" is not a valid value for the "disable" directive, or even justinvalid directive