Skip to content

Handle SCRIPTDIR in source-path-directives #759

Open
@tstenner

Description

@tstenner

What is the problem this feature will solve?

The lsp currently handles constructs like

# foo/test.
# shellcheck source=bar/baz.sh
source $someDir/baz.sh
# shellcheck source-path=SCRIPTDIR
source ./bar/baz.sh

What's missing is paths containing SCRIPTDIR, i.e.

# shellcheck source=SCRIPTDIR/bar/baz.sh
source baz.sh
# shellcheck source-path=SCRIPTDIR/bar/

What is the feature you are proposing to solve the problem?

Shellcheck directives should handle SCRIPTDIR in paths, e.g. SCRIPTDIR/foo.sh or SCRIPTDIR/../someFolder/

What alternatives have you considered?

Changing the paths in the source statements, but the analyzed files will be copied to different locations depending on runtime factors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions