alecthomas / SublimeLinter-contrib-gometalinter

SublimeLinter plugin for gometalinter
MIT License
47 stars 13 forks source link

Use different strategies for background and save linting. #6

Closed alecthomas closed 8 years ago

alecthomas commented 8 years ago

@ottob this should now work with the custom SublimeLinter environment.

alecthomas commented 8 years ago

Let me know if there are any issues.

ottob commented 8 years ago

Still path issue:

env = os.environ.copy()
if self.env:
    env.update(self.env)
print('gometalinter: path: {}'.format(env['PATH']))

gometalinter: path: /usr/bin:/bin:/usr/sbin:/sbin

SublimeLinter: computed PATH using /bin/bash:
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/go/bin
/Applications/Postgres.app/Contents/Versions/latest/bin
/Users/ottob/go/bin

This is when I don't start from Terminal

ottob commented 8 years ago

And sorry about the tmpdir comment. I didn't realise that it was a Python function from std lib.

ottob commented 8 years ago

self.env is not set so env.update is not run.

ottob commented 8 years ago

And I still get gometalinter: path: /usr/bin:/bin:/usr/sbin:/sbin

even if I edit my SublimeLinter config:

"paths": {
            "linux": [],
            "osx": [
                "~/go/bin"
            ],
            "windows": []
        },
alecthomas commented 8 years ago

Yeah I've found the problem. I need to use lint.util.popen from SublimeLinter, which does all the env setup magic. Should be done soon.

ottob commented 8 years ago

Nice!

alecthomas commented 8 years ago

Okay, try that one out.

ottob commented 8 years ago

Works as expected now. Thanks!

alecthomas commented 8 years ago

Brilliant!

ottob commented 8 years ago

Perhaps also update the README with known issue: linting code using vendoring will not work in background mode.