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
When using --include=SC2250 (or other optional checks), ShellCheck silently produces no output instead of warning the user that the check needs to be enabled first with --enable.
This creates a confusing user experience where the --include flag appears to not work, when in reality it requires an undocumented additional flag to function.
This is particularly problematic when users are trying to enforce specific coding standards, as they may incorrectly assume their checks are being applied when they are actually being silently ignored.
The rule's wiki page does not already cover this
I have cloned the repo and installed with cabal and this is still a problem.
Here's a snippet or screenshot that shows the problem:
#!/bin/bashset -- "-$ASCII_CONVERSION""$@"
Here's what shellcheck currently says with just --include:
$ shellcheck --include=SC2250 test.sh
# No output
Here's what shellcheck says with both flags:
$ shellcheck --enable=all --include=SC2250 test.sh
In test.sh line 2:
set -- "-$ASCII_CONVERSION""$@"
^---------------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
Here's what I wanted or expected to see:
The --include flag should either:
Work independently for all check codes, including optional ones, OR
Provide a clear error message when trying to include an optional check without enabling it
The current behavior is confusing because:
The manual doesn't clearly state that --include won't work for optional checks without --enable
There's no warning or error when trying to include an optional check without enabling it
Using --include alone silently fails instead of indicating that the check needs to be enabled first
This makes debugging and configuring ShellCheck more difficult than necessary, especially for users who are trying to enforce specific coding standards.
Additional Context:
The manual does document both flags separately but doesn't explicitly state their interdependency:
--include is described as explicitly including specified codes
--enable is described as enabling optional checks
There's no mention that --include won't work for optional checks without --enable
A user would reasonably expect that --include=SC2250 would either:
Include and enable the check
Or produce an error message explaining why no warnings are generated
Instead, it silently produces no output, leading to confusion about whether the check is working at all.
The text was updated successfully, but these errors were encountered:
When using
--include=SC2250
(or other optional checks), ShellCheck silently produces no output instead of warning the user that the check needs to be enabled first with--enable
.This creates a confusing user experience where the
--include
flag appears to not work, when in reality it requires an undocumented additional flag to function.This is particularly problematic when users are trying to enforce specific coding standards, as they may incorrectly assume their checks are being applied when they are actually being silently ignored.
Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says with just --include:
$ shellcheck --include=SC2250 test.sh # No output
Here's what shellcheck says with both flags:
Here's what I wanted or expected to see:
The
--include
flag should either:The current behavior is confusing because:
--include
won't work for optional checks without--enable
--include
alone silently fails instead of indicating that the check needs to be enabled firstThis makes debugging and configuring ShellCheck more difficult than necessary, especially for users who are trying to enforce specific coding standards.
Additional Context:
The manual does document both flags separately but doesn't explicitly state their interdependency:
--include
is described as explicitly including specified codes--enable
is described as enabling optional checks--include
won't work for optional checks without--enable
A user would reasonably expect that
--include=SC2250
would either:Instead, it silently produces no output, leading to confusion about whether the check is working at all.
The text was updated successfully, but these errors were encountered: