Skip to content

Support for pre-declared "external" globals for sourced scripts to avoid SC2154 warnings. #356

@deryni

Description

@deryni

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions