alecthomas / SublimeLinter-contrib-gometalinter

SublimeLinter plugin for gometalinter
MIT License
47 stars 13 forks source link

filter errors by current file #19

Closed vkd closed 6 years ago

vkd commented 6 years ago

goconst linter return error not only by current file, and then SublimeLinter crash on it.

From: https://github.com/SublimeLinter/SublimeLinter/issues/1256#issuecomment-381920068

alecthomas commented 6 years ago

Are you sure that's what's happening? It should already be filtering, by passing -I <filename> to gometalinter.

vkd commented 6 years ago

Yes, I retried now:

⇒  gometalinter -I spot.go --fast
...
campaign.go:392:13:warning: 2 other occurrence(s) of "name" found in: application.go:169:13 spot.go:283:13 (goconst)
application.go:169:13:warning: 2 other occurrence(s) of "name" found in: campaign.go:392:13 spot.go:283:13 (goconst)
spot.go:283:13:warning: 2 other occurrence(s) of "name" found in: campaign.go:392:13 application.go:169:13 (goconst)

I think because `gometalinter' have match by regexp:

-I, --include=REGEXP ...     Include messages matching these regular expressions.

And at the same time string spot.go exists in the error line.

But I have more clear fix of this problem - using -I ^spot.go. What you think?

alecthomas commented 6 years ago

Ah of course. Yes, that sounds like a preferable solution, thanks!

vkd commented 6 years ago

Fixed by #20