Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cover: add number of uncovered lines #31519

Open
rabadin opened this issue Apr 17, 2019 · 8 comments
Open

cmd/cover: add number of uncovered lines #31519

rabadin opened this issue Apr 17, 2019 · 8 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@rabadin
Copy link

rabadin commented Apr 17, 2019

The coverage HTML file generated by go tool cover -html=coverage.out only displays the coverage percentage per package; as a result it's hard to identify, by just glancing at the list of packages and their coverage, where the coverage is lacking because small packages and giant packages are treated the same.
This is a feature request to add, in addition to the coverage percentage, the number of lines that are uncovered: this will enable to see what packages are big contributors to the lack of coverage.

@gopherbot
Copy link

Change https://golang.org/cl/172424 mentions this issue: cmd/cover: add feature to sort packages in coverage HTML file

@robpike
Copy link
Contributor

robpike commented Apr 17, 2019

There are external tools such as IDEs that read this file format, so this would be a breaking change to them. Regardless of its own merits, a change like this needs to be rolled out carefully.

@agnivade agnivade added this to the Unplanned milestone Apr 18, 2019
@rabadin
Copy link
Author

rabadin commented Apr 18, 2019

Thanks for the reply @robpike! Note that I'm not talking about changing the format of the coverage itself, only that of the HTML file produced by go tool cover -html=coverage.out. Is this HTML file read by IDEs?
In the comment to the related change (https://go-review.googlesource.com/c/go/+/172424/) I have an example of the "improved" HTML.

@robpike
Copy link
Contributor

robpike commented Apr 18, 2019

Ah, I misunderstood. I don't know if IDEs read the HTML, but I doubt it.

@rabadin
Copy link
Author

rabadin commented Apr 18, 2019

Ah, I misunderstood. I don't know if IDEs read the HTML, but I doubt it.

Same here, I believe it's reasonably safe to change the HTML.

@bcmills
Copy link
Contributor

bcmills commented May 28, 2019

CC @ianthehat

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 28, 2019
@ianthehat
Copy link

I would be very surprised if any tool/integration is attempting to parse the HTML (I don't know of one), and I don't think it would be sensible to refuse changes if that was the only reason. The HTML output should never be a stable supported API!

@rabadin
Copy link
Author

rabadin commented May 28, 2019

@ianthehat Totally agree... I think the only "interface" the HTML should fulfill is to be valid HTML ;).

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants