SublimeLinter-golangcilint icon indicating copy to clipboard operation
SublimeLinter-golangcilint copied to clipboard

fix:

Open Am6er opened this issue 5 years ago • 3 comments

* absolute path issue for golangci-lint
* args issue

Am6er avatar Mar 08 '20 20:03 Am6er

Please describe the "absolute path issue for golangci-lint". The change introduced would change the linter behavior from linting the path the current edited file is in to "just the file". If people want to change that (often?), maybe it should configurable. Other people might want to lint the whole project, or the path plus its subdirectories.

Adding ${args} is usually a good idea.

kaste avatar Mar 09 '20 10:03 kaste

About "absolute path issue": 1.Clean version of ST. go version 1.14. golangci-lint current version. Mac OS current version. 2.Install via Package Control: SublimeLinter, SublimeLinter-golangcilint. Turn "debug":true in SublimeLinter. 3.Open any Go source, and recieve in ST console:

SublimeLinter: #1 linter.py:1636 Running ...

/Users/amber/Documents/GitHub/Test (working dir) $ /Users/amber/go/bin/golangci-lint run --fast --out-format tab /Users/amber/Documents/GitHub/Test

SublimeLinter: #1 linter.py:786 WARNING: golangcilint output: level=error msg="[runner/goanalysis_metalinter] typechecking error: import "/Users/amber/Documents/GitHub/Test": cannot import absolute path" level=warning msg="[runner] Can't run linter goanalysis_metalinter: assign: failed prerequisites: inspect@/Users/amber/Documents/GitHub/Test" level=error msg="Running error: assign: failed prerequisites: inspect@/Users/amber/Documents/GitHub/Test"

Am6er avatar Mar 09 '20 18:03 Am6er

Thank you, can you please more run tests? For example, with a project using Go modules, with a project inside the deprecated GOPATH directory, with a project using a vendor folder. The more tests the better. I agree with Kaste, it is better to be cautious with these changes.

cixtor avatar Mar 09 '20 18:03 cixtor