We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
declare -n
Rule Id (if any, e.g. SC1000): SC1087
My shellcheck version (shellcheck --version or "online"): 0.7.1
shellcheck --version
The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit
I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related
SC1087 check does not allow dynamic variables #640 is related but this seems more reasonable as an exception when using declare -n.
#!/bin/bash declare -A array=() # shellcheck disable=SC2034 # Used through declare -n array[key]=value variable_name=array declare -n variable="$variable_name[key]" echo "$variable"
Line 7: declare -n variable="$variable_name[key]" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet).
No error.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For bugs
Rule Id (if any, e.g. SC1000): SC1087
My shellcheck version (
shellcheck --version
or "online"): 0.7.1The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit
I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related
SC1087 check does not allow dynamic variables #640 is related but this seems more reasonable as an exception when using
declare -n
.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:
No error.
The text was updated successfully, but these errors were encountered: