-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
For bugs with existing features
- Rule Id (if any, e.g. SC1000): SC2329
- My shellcheck version (
shellcheck --version
or "online"): 0.11.0 - 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
Here's a snippet or screenshot that shows the problem:
#!/bin/bash
func1(){ echo 'func1 called'; }
i=1
"func${i}"
exit 0
Here's what shellcheck currently says:
In test line 2:
func1(){ echo 'func1 called'; }
^-----------------------------^ SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly).
Here's what I wanted or expected to see:
Nothing, since the function is called. It might be expected behavior, similar to how function calls from traps are not recognized (yet), but at least the wiki does not mention it. There are other checks where shellcheck
takes into account variables, so probably it is possible here as well for unconditionally assigned variables.
Metadata
Metadata
Assignees
Labels
No labels