Open anlutro opened 5 years ago
I just ran into the same thing. db_go too.
I am seeing the same issue.
Same here, shellcheck 0.8.0
Same issue sourcing my function library.
andrew $ shellcheck --version
ShellCheck - shell script analysis tool
version: 0.7.0
license: GNU General Public License, version 3
website: https://www.shellcheck.net
0.7.0 is getting a tad old at this moment (2020). Consider updating.
That said, this problem is till present in the latest HEAD.
Given a function defined in a sourced file that has optional arguments, shellcheck treats it as if it's a mistake to not pass any arguments.
Minimal reproducible setup:
If the function is defined in the same file, you correctly get a warning that the function is never called with arguments, but here this is not the case.
I ran into this when using
db_go
which is defined in/usr/share/debconf/confmodule
on Debian/Ubuntu systems.