Open ShamrockLee opened 7 months ago
While not satisfactory, I have found this at least useful while working on Nixpkgs:
# shellcheck source=<relative path to pkgs/stdenv/generic/setup.sh>
source /dev/null
While not satisfactory, I have found this at least useful while working on Nixpkgs:
# shellcheck source=<relative path to pkgs/stdenv/generic/setup.sh> source /dev/null
What an excellent workaround for #356!
Per-source check-sourced would still be helpful when refactoring a codebase filled with un-lint scripts or excluding the warnings from an external shell library.
For bugs
shellcheck --version
or "online"):For new checks and feature suggestions
Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
ShellCheck currently doesn't provide such directive.
Here's what I wanted or expected to see:
ShellCheck includes warning from
clean.sh
but not frommessy.sh
.Motivation:
messy.sh
cannot be changed from the project scope.source
s the pre-sourced files before sourcing the target script to check. The directive proposed here helps exclude warnings from pre-sourced files, while include warnings from the target script.