reviewdog / errorformat

Vim's quickfix errorformat implementation in Go
https://reviewdog.github.io/errorformat-playground/
MIT License
109 stars 43 forks source link

Add govet new format #144

Closed seiyab closed 8 months ago

seiyab commented 8 months ago

Related issue: https://github.com/reviewdog/reviewdog/issues/933

I've reproduced https://github.com/reviewdog/reviewdog/issues/933. I found that reports from go vet is misparsed. In master branch:

$ echo "./main.go:7:2: fmt.Printf format %s has arg x of wrong type int" | go run ./cmd/errorformat -name=govet
./main.go:7|2| fmt.Printf format %s has arg x of wrong type int

Maybe it causes mismatch in filename so reviewdog doesn't report error. Though I haven't investigate changelog, I guess that error format of go vet has changed. I added a new (?) format and leave old (?) one.

My environment:

$ go version
go version go1.21.1 darwin/arm64

Minimal reproduction: run reviewdog on https://github.com/seiyab/repro/tree/43554945d9154c76a4266237492cfe83e707ee08/reviewdog-fixture

seiyab commented 8 months ago

String() method of token.Position optionally appends column. And go vet prints it. https://cs.opensource.google/go/go/+/refs/tags/go1.22.1:src/go/token/position.go;l=39-54

review-dog commented 8 months ago

Hi, @seiyab! We merged your PR to reviewdog! 🐶 Thank you for your contribution! ✨

We just invited you to join the @reviewdog organization on GitHub. Accept the invite by visiting https://github.com/orgs/reviewdog/invitation. By joining the team, you'll be a part of reviewdog community and can help the maintenance of reviewdog.

Thanks again!