-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
For new checks and feature suggestions
- https://www.shellcheck.net/ (i.e. the latest commit) currently gives no useful warnings about this
- I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related
The Issue
Hello, and thanks for the excellent tool.
I am not sure whether this is a bug or a missing feature, but I expect enable directives and disable directives to have symmetrical syntax. But they don't, as illustrated by the following code snippet:
# shellcheck enable=check-extra-masked-return
# shellcheck disable=check-set-e-suppressedThe enable directive works, but the disable directive chokes:
In ./bash/.bash_profile_remote line 7:
# shellcheck disable=check-set-e-suppressed
^-- 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...
The current workaround is to specify the short-hand code instead of the long name, like this:
# shellcheck enable=check-extra-masked-return
# shellcheck disable=SC2310
But doing this is confusing, because when you are enabling and disabling a bunch of rules, it looks buggy to have the long names for all of the enable directives and then using the short name for all of the disable directives.
I can try to submit a PR to fix this if needed.
Metadata
Metadata
Assignees
Labels
No labels