Skip to content

Make diff information available about "new" lines #117

Description

@loganharbour

From a code review prospective, we've found it valuable to have information about the lines of code that are edited (I refer to this here as "new"). I produce a table like this on PRs:

b79d3c #18890 d0b30f
Total Total +/- New
Rate 81.56% 81.56% +0.01% 100.00%
Hits 69452 69480 +28 29
Misses 15706 15707 +1 0

Where the new line coverage is generated with something like this:

differ = CoberturaDiff(base_cobertura, head_cobertura)
summary = {'hits': 0, 'misses': 0}

for file in differ.files():
    for line in differ.file_source(file):
        if line.status is not None and line.reason == 'line-edit':
            hits_misses_key = 'hits' if line.status else 'misses'
            summary[hits_misses_key] += 1

I'm curious if this has any place here instead - maybe at the very least as a helper that will produce something as such? I don't mind keeping this in our local generation, but the peace of mind of having it tested here instead is nice.

EDIT: maybe this has a better place in Discussions to get that kicked off?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions