SublimeLinter / SublimeLinter-shellcheck

This linter plugin for SublimeLinter provides an interface to shellcheck.
MIT License
210 stars 20 forks source link

Setting PATH environment variable doesn’t find executable #28

Open niksy opened 3 years ago

niksy commented 3 years ago

If I set PATH environment variable in Shellcheck linter settings, it doesn’t read it correctly.

For example, this configuration should find my custom shellcheck executable inside ~/.becky/bin directory, but that doesn’t work. Same configuration for ESLint and Stylelint does work.

{
  "linters": {
    "shellcheck": {
      "selector": "source.shell",
      "env": {
        "PATH": "~/.becky/bin:$PATH"
      }
    }
  }
}

If I set path using global paths property, this does work but I would still like option of setting custom PATH only for Shellcheck and would expect it to work just like for other linters.

kaste commented 3 years ago

That's a known limitation. The "env" mapping is used for the linter (child-) process not to enhance the (parent) lookup process (which would be the shared python plugin host process of Sublime Text).

An implementation must be provided in SublimeLinter core. There is a ticket open over there; shouldn't be too complicated to do actually.

niksy commented 3 years ago

That's a known limitation. The "env" mapping is used for the linter (child-) process not to enhance the (parent) lookup process (which would be the shared python plugin host process of Sublime Text).

An implementation must be provided in SublimeLinter core. There is a ticket open over there; shouldn't be too complicated to do actually.

Which ticket exactly?

kaste commented 3 years ago

Conecptually it's part of https://github.com/SublimeLinter/SublimeLinter/issues/1795 Using env/PATH is the first step to implement 1795.