-
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
SC2178/SC2128 false positives on local variables #680
Comments
Saw the mention on the SC2178 page. Close if you want to, not too much refactoring needed to work around this. |
Unsure if things have changed, but whilst clearing up old warnings I noticed that the above code can be fixed by simply changing local baz="" to local baz #!/bin/bash
foo () {
local baz=()
echo "${baz[@]}"
}
bar () {
local baz
echo "$baz"
} |
Also functions defined using outer parens rather than braces like:
should not trigger these warnings. I use parens for defining functions as much as possible as it limits global side-effects. |
The text was updated successfully, but these errors were encountered: