We have a series of scripts that operate on a set of shared variables that are created by the top-level script.
The secondary scripts use these variables without declaring them as they are known to exist when run.
shellcheck, obviously, doesn't know this. It would be nice if we could tell it about acceptable external global variables to disable SC2154 warnings about them.
I realize we could use # shellcheck disable=SC2154 for them but that's a larger hammer than I would like as it will also disable other warnings from typos and the like if they happen to appear on that line.
The context=sourced suggestion from #281 is somewhat related to this request.
We have a series of scripts that operate on a set of shared variables that are created by the top-level script.
The secondary scripts use these variables without declaring them as they are known to exist when run.
shellcheck, obviously, doesn't know this. It would be nice if we could tell it about acceptable external global variables to disable SC2154 warnings about them.
I realize we could use
# shellcheck disable=SC2154for them but that's a larger hammer than I would like as it will also disable other warnings from typos and the like if they happen to appear on that line.The
context=sourcedsuggestion from #281 is somewhat related to this request.