pycobertura
pycobertura copied to clipboard
Generate a text report for Terminal with Colors (show command)
I think it would be helpful to have a reporter for Terminal, showing colors depending on the coverage percentage for each covered file.
I think it would be helpful to have a reporter for Terminal, showing colors depending on the coverage percentage for each covered file.
We do have one, but it's limited to rendering the summary table. It doesn't render the source code. I agree we should provide the full experience. Thanks for reporting.
Do you want to take a stab at it? I could provide some guidance.
Hi @aconrad. I've just seen colors only in the diff command, not in the show command, am I missing something?
Hi @ericnordelo Which columns would you like to have in color: for Miss
and Missing
columns or also user-definable for the Cover
column?
I'm thinking of color by row, not by column. For example, red row if coverage is under 60 percent, yellow row if coverage is between 60 and 80, and green row if is greater than 80.
Row representing a file or a directory.
@ericnordelo oh, you are right. We don't show colors for pycobertura show
. The main reasoning is that what is considered "good" or "bad" is personal/subjective. In addition, using the coverage percentage (line rate) as a metric to determine if the code is good or not hasn't proven to be a stable metric. You can read more about it in the FAQ: Why is the number of uncovered lines used as the metric to check if code coverage worsened rather than the line rate?