favadi / flycheck-gometalinter

Flycheck checker for gometalinter
BSD 2-Clause "Simplified" License
57 stars 8 forks source link

Gometalinter deadline exceeded #12

Closed mrmagooey closed 7 years ago

mrmagooey commented 7 years ago

On my dual core laptop, gometalinter is exceeding the deadline for the linters and producing:

Suspicious state from syntax checker gometalinter: Checker gometalinter returned non-zero exit code 2, but no errors from output: <?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="5.0"></checkstyle>
WARNING: deadline exceeded by linter structcheck (try increasing --deadline)
WARNING: deadline exceeded by linter megacheck (try increasing --deadline)
WARNING: deadline exceeded by linter errcheck (try increasing --deadline)
WARNING: deadline exceeded by linter varcheck (try increasing --deadline)
WARNING: deadline exceeded by linter vetshadow (try increasing --deadline)
WARNING: deadline exceeded by linter aligncheck (try increasing --deadline)
WARNING: deadline exceeded by linter gotype (try increasing --deadline)
WARNING: deadline exceeded by linter gas (try increasing --deadline)
WARNING: deadline exceeded by linter deadcode (try increasing --deadline)
WARNING: deadline exceeded by linter unconvert (try increasing --deadline)
WARNING: deadline exceeded by linter golint (try increasing --deadline)
WARNING: deadline exceeded by linter goconst (try increasing --deadline)
WARNING: deadline exceeded by linter interfacer (try increasing --deadline)
WARNING: deadline exceeded by linter gocyclo (try increasing --deadline)

Checker definition probably flawed.

It seems that gometalinter is producing these warnings on stderr, and then the output is no longer in the checkstyle format. Possibly I should just increase the deadline, but it seems like either way that the tool shouldn't throw errors? Is there any way to only take the stdout stream and ignore the errors on stderr that cause flycheck to throw errors?

favadi commented 7 years ago

I'm not sure how other checker handles this. IMO, in this case as the checker returned an error anyway, the output might be useful to debug. What do you think?

mrmagooey commented 7 years ago

So my interim approach has been:

  1. Fork gometalinter and add a flag ("quiet-warnings") disabling deadline exceed warnings on stderr, and keeping its return code as 0 (https://github.com/mrmagooey/gometalinter/tree/squelch_warnings),
  2. Also adding this custom "quiet-warnings" flag to my local version of flycheck-gometalinter.

But, I realise that this squelching of warnings is basically a "fail silently" fix, which for the moment is fine by me but probably won't be fine for most people.

Another possible fix would be to make the deadline option from the gometalinter call an optional one, or perhaps to bump the default deadline timeout up to 10s.

On reflection I can't think of an absolute fix that would work for everyone, so I might just close this issue. Thanks for the quick response though.