Add total line count to coverage paint for programmatic usage #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As Jenkins Pipeline scripts are becoming more prevalent, programmatic usage of plugin results will become more common. In this case, the result of the Cobertura plugin invocation in the pipeline can be used to feed other plugins, or published to code review systems. In support of such ends,
CoveragePaint
was missing a bit of information: The total number of lines in the file, including non-executable lines. Absent this, our code is having to re-open and re-read every line of every source file which theSourceCodePainter
has already opened and read, just to count the total number of lines to send to our code review system along with the coverage paint information. This simple change eliminates the duplicate file reading and makes the Cobertura results more usable in a programmatic way.NOTE: I had planned to file a feature request for this and THEN submit the pull request for it, but the issue tracking system flagged me as spam and I am still waiting on someone to review it.