Pass --external-sources to shellcheck
Many shell scripts use "source" to include other scripts. This option tells shellcheck to parse those external scripts, so that the remainder of the script can be properly linted.
Can't find when they added this flag nor any further descriptions 🙄 Any downsides to just add unconditional for everyone? Otherwise makes sense and lgtm.
It's a flag to enable this behavior, so to me that says it's not supposed to be on all the time. I don't feel like having to figure out if there are downsides, or having to take it out again at a later stage because it causes problems for someone. If we bake it in like this, you can't take it out. There is also no need to bake it in: if you want this behavior you can configure args for the linter. So I don't really see a good reason to merge this PR. If I'm wrong, please let me know!
Can't find when they added this flag nor any further descriptions 🙄 Any downsides to just add unconditional for everyone? Otherwise makes sense and lgtm.
See https://github.com/koalaman/shellcheck/issues/902.
Easier and more admin-friendly, as always, is the .shellcheckrc file (but it does not work for a long time, https://github.com/koalaman/shellcheck/issues/1811)
Since for example ale and other IDEs set this as explained in https://github.com/koalaman/shellcheck/issues/902 we can do this too. Though instead of hard-coding it into cmd, doing it via defaults users have the chance to opt-out. For example
defaults = {
...
"--external-sources": True,
}
is probably the better patch.