favadi / flycheck-gometalinter

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

lint error line number off-by-one #11

Closed helinwang closed 6 years ago

helinwang commented 7 years ago

Appreciate the repo! Very helpful.

I have one quesiton, when using it, the underline changed to "aboveline":

screen shot 2017-05-26 at 1 52 44 pm

As shown in the picture, I think the red line show be below the code, not above the code. Any idea how to fix it?

My configuration is in this repo: https://github.com/helinwang/go-emacs/

Thanks!

jackbearheart commented 6 years ago

I see this too.

Looks like for the checkstyle output from gometalinter, gometalinter indicates "column 0", but with the correct line number, and then flycheck interprets this to be the previous line. As a temporary workaround I added

        col := 1
        if issue.Col > 0 {
            col = issue.Col
        }

to my gometalinter checkstyle.go... this is still very ugly.

I haven't gone further into this. Either 1) the gometalinter checkstyle output from certain linters needs to be improved so that it sets the column correctly or 2) the flycheck checkstyle parser needs to handle column=0 more nicely.

In either case, the bug is not really in flycheck-gometalinter, which is just an adapter from gometalinter --checkstyle to flycheck.

helinwang commented 6 years ago

Thanks for your input! Glad to know about what is really going on. I just got used to the problem :p