matm / gocov-html

Make pretty HTML output from gocov, a coverage testing tool for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Formatting of code in the report

cznic opened this issue · comments

Hi,

like this tool! Ad title: The source code in the report has sometimes malformed indentation (off by one level in both ways: 1 too much or 1 too les). It's only cosmetic, the tool is usable anyway. Thanks for publishing it.

Yes, I noticed that issue. Can't work on it for now but I'm accepting patches :) Thanks for your feedback!

Verified the fix, it works AFAICS, thus closing the issue (leaving the N spaces TODO up to you). Thanks for accepting the patch. The tool is now perfect in every aspect I have for the time being. (Will delete my fork, no reason for it to exist anymore.)

Fine. I'll try to address this indent bug ASAP.

I'm confused. The bug in indentation of the code shown in the report is already fixed by replacing \t by N spaces as seen here:

https://github.com/matm/gocov-html/blob/master/cov/annotate.go#L109

I verified it works from a fresh clone of your repo and making a fresh binary of the tool and it works okay. That's why I closed this issue.

Commit 1319ef2 made it broken again.

In annotate.go:

s/strings.Replace(line, "\t", "        ", 1)/strings.Replace(line, "\t", "        ", -1)/

Fixed. Thanks for reporting, that was a typo...