Skip to content

shellcheck source= directive is processed differently than shellcheck #203

Description

@jakub-bochenski

Shellcheck resolves source directive relative to the working directory that it was executed, no relative to the file, e.g.

src/
  - sourcing.sh
  - source.sh

If you run shellcheck from project root it expects the sourcing.sh file to have

  # shellcheck source=src/source.sh

BashSupport-Pro resolves the directive relative to the file it's in, so it expects:

  # shellcheck source=../src/source.sh

So either the directive will fail for CLI shellcheck or for the plugin.

I think it's reasonable for the plugin to assume that shellcheck would be run from project root.
An additional setting to override this might be useful.

$ shellcheck --version 
ShellCheck - shell script analysis tool
version: 0.9.0
license: GNU General Public License, version 3
website: https://www.shellcheck.net

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions