Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Optionally enable go-metalinter support? #17

Closed
NHOrus opened this issue Nov 18, 2015 · 14 comments
Closed

Optionally enable go-metalinter support? #17

NHOrus opened this issue Nov 18, 2015 · 14 comments

Comments

@NHOrus
Copy link

NHOrus commented Nov 18, 2015

Currently, Metalinter is extremely useful linter.
Go Vet, Go Lint and other highly useful tools are included
As it provides massaged output of composite linters, is it possible to use it as (optional) replacement/enchancement for aforementioned Vet and Lint tools?

@lukehoban
Copy link
Member

Sounds like a great idea.

Should be easy to add support for that either as the default linter or as an option to use instead of discreet lint/vet.

@lukehoban
Copy link
Member

Open to PR's adding support for this.

I'd suggest adding a go.lintTool setting that can optionally point to an alternate tool to run instead of golint. That would allow users to opt-in to using gometalinter once they have installed and configured it.

A further step would be to make it the default. I think we should wait on that, since the acquisition experience for gometalinter is incrementally more complex.

@joeblew99
Copy link

this would be awesome !

@gobijan
Copy link

gobijan commented Mar 22, 2016

I came here because I wanted to propose support for https://github.com/alecthomas/gometalinter, too :)
Atoms Go Plugin and SublimeText have support for this. Maybe one could have a look at the Atom implementation for adding support to vscode (are the APIs similar because of the electron shell?): https://atom.io/packages/gometalinter-linter

@sijad
Copy link
Contributor

sijad commented Mar 28, 2016

@lukehoban output of golint and gometalinter are a little different, with current regex can't parse gometalinter output

@lukehoban
Copy link
Member

@sijad Feel free to propose an update to the regexp to make sure gometalinter output can be handled.

@johansja
Copy link

There is an PR for this.Wondering what is the progress on that? @sijad @lukehoban

@punya
Copy link

punya commented Jun 7, 2016

gometalinter can also produce JSON output, if that makes parsing easier.

@joeblew99
Copy link

@lukehoban JSON parsing helps ?
I am keen to get this into VSCode :)

@egamma
Copy link
Member

egamma commented Jun 8, 2016

I suggest to look into how some of the existing linters are implemented for VS Code. ESLint is a good example vscode-eslint, tslint, and jshint are implemented in the same way. The idea is to implement a linter as a language server. The language server is kept a live and receives buffer change requests from VS Code (over JSON RPC), runs the linter (in proc) on the changed buffer, and returns the errors diagnostics back to VS Code. Doing the linting inside a server avoids that a new process is restarted for each validation as the user types.

@sijad
Copy link
Contributor

sijad commented Jun 8, 2016

#294 is almost finished, it just need a review I guess

@egamma
Copy link
Member

egamma commented Jun 8, 2016

Nice. This implementation spawns a new process for each linting pass. Since the linter is native code and since this is only done on save this might not be too bad for the batteries.

@mattetti
Copy link
Contributor

This issue can be closed now that the feature is implemented and documented :)

@lukehoban
Copy link
Member

Indeed. Thanks @sijad.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants