koalaman / shellcheck

ShellCheck, a static analysis tool for shell scripts
https://www.shellcheck.net
GNU General Public License v3.0
36.45k stars 1.78k forks source link

"external-sources=true" in my .shellcheckrc isn't working, but "-x" on the command line does #2896

Closed djmills64 closed 9 months ago

djmills64 commented 10 months ago

For bugs

For new checks and feature suggestions

Here's a snippet or screenshot that shows the problem:

$ shellcheck -x AddRole.sh

produces no output. But without the "-x" I get:


In AddRole.sh line 42:
. constants.sh
  ^----------^ SC1091: Not following: constants.sh was not specified as input (see shellcheck -x).

In AddRole.sh line 43:
. functions.sh
  ^----------^ SC1091: Not following: functions.sh was not specified as input (see shellcheck -x).

The .shellsheckrc file in the same directory contains:

# .shellcheckrc

external-sources=true
disable=SC2162

The "external-sources=true" line is not having the desired effect. The disable line is working - thus confirming that the file is used.

Here's what shellcheck currently says:

Here's what I wanted or expected to see:

koalaman commented 9 months ago

Unfortunately the external-sources directive is only supported in ShellCheck v0.8.0 and up!

djmills64 commented 9 months ago

Thanks. It doesn't seem to be possible to specify multiple folders with "source-path="

I attempted to add a 2nd folder with a colon in between, but then neither folder works. Please advise if there's a way.

djmills64 commented 9 months ago

Actually it looks like colon separated works on the command line, but from a .shellcheckrc file you seem to need multipe "source-path=" entries. If that is correct, please add to the documentation.