-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SC2319 - confusing warning message when checking $? after [[ ]] #2544
Comments
Agreed, your pattern was listed under "Exceptions". However, the check has now been updated to exclude cases where the |
Thanks for the fix! The change works great. |
Hi all!! Conducted a test on the site https://www.shellcheck.net Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
|
For bugs
shellcheck --version
or "online"): v0.8.0-45-gd1d574cFor new checks and feature suggestions
Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
Here's what I wanted or expected to see:
It's confusing that shellcheck is telling me to assign
$?
to a variable on the line where I assign$?
to a variable.It's not clear why I shouldn't be checking the exit-code of "[[]]" - that's the whole point of "[[]]". None of the "problematic code" examples in the wiki look like the code I have, also.
Better descriptions or examples around why this construction is problematic would be helpful.
The text was updated successfully, but these errors were encountered: