Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: add a "go build" linter mode #1043

Closed
theckman opened this issue Apr 23, 2020 · 4 comments · Fixed by #1861
Closed

Feature Request: add a "go build" linter mode #1043

theckman opened this issue Apr 23, 2020 · 4 comments · Fixed by #1861
Labels
enhancement New feature or improvement

Comments

@theckman
Copy link
Contributor

Hi there,

I'm running in to a limitation in my editor that I wonder if the golangci-lint project would be willing to help with, while acknowledging it may be beyond your scope.

The summary is in my editor right now, I can either get compilation failures or errors from golangci-lint not both. Would it be possible to have golangci-lint report compilation failures in the same format as it does for other linters, so that my editor can show them?

Thank you for your consideration on this idea!

Cheers!
-Tim

@ernado
Copy link
Member

ernado commented Apr 23, 2020

Sounds reasonable.

PR's are welcome as always :)

@ernado ernado added the enhancement New feature or improvement label Apr 23, 2020
@pierrre
Copy link
Contributor

pierrre commented Apr 25, 2020

IMO if there is a compilation failure, we should not attempt to "lint" the code, because it's not valid.

@ernado
Copy link
Member

ernado commented Apr 25, 2020

That's correct, but currently error is pretty cryptic and we can be more user friendly.

@ryancurrah
Copy link
Member

ryancurrah commented May 31, 2020

I've been looking at this to try and raise compile errors as lint issues. I am having some trouble figuring out how to handle this.

So I know scanner.ErrorList here https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/goanalysis/runner.go#L1330-L1338 contains the compilation errors but I am not sure how to convert these errors to a lint issue.

@jirfag or @ernado do you have some guidance for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants