go-nyet icon indicating copy to clipboard operation
go-nyet copied to clipboard

Not a superset of "go vet"

Open alecthomas opened this issue 10 years ago • 2 comments

I'm not sure if this is intentional, but go-nyet doesn't pick up some issues that go vet does. eg.

devtodo2$ go vet .
importer.go:29: possible formatting directive in fatal call
importer.go:39: possible formatting directive in fatal call
main.go:115: possible formatting directive in fatal call
main.go:126: possible formatting directive in fatal call
main.go:174: possible formatting directive in fatal call
main.go:189: possible formatting directive in fatal call
main.go:237: possible formatting directive in fatal call
main.go:284: possible formatting directive in fatal call
main.go:288: possible formatting directive in fatal call
main.go:336: possible formatting directive in fatal call
exit status 1
devtodo2$ go-nyet .
consoleview.go:67:2:Odd decl (const, import, or type) in body

This is not a big deal, but it does also seem to include some checks that are the same for both, so if you run both tools you sometimes get duplicates.

Basically I'd like to run either both of them, or just one of them, get the same coverage, and not get duplicates.

alecthomas avatar Feb 20 '15 22:02 alecthomas

Fair point -- I've imagined that you run both of them and they catch different things.

The error you've pointed to here is really just a debugging message and not an error, so I should fix that for sure.

barakmich avatar Feb 20 '15 23:02 barakmich

Hi @barakmich, Thanks for creating this tool!

I think it would be nice if go-nyet would be usable as a superset of go-vet directly, in the same way goimports and goreturns are for gofmt. What would be required for this is:

  • Add support for the -n and -x flags
  • Consistent output (file.go:123: lower case error message)
  • Run go-vet with same parameters
    • Optionally: Run go vet for each package seperately and buffer all lines for both go vet and go-nyet and sort alphabetically (could also remove duplicates at this stage).

This would make go-nyet a hot-plugable alternative in IDE's. In the same way as goimports and goreturns currently are. For instance in the atom go-plus plugin.

GeertJohan avatar Mar 30 '15 07:03 GeertJohan