Closed MGatner closed 4 years ago
I think the blocks indicates the number of additions and deletions and shown relative to each other, so not relative to the file (either before or after the change).
The number of lines added/deleted is within the result of Differ::diffToArray
which you could process to the output you want.
Or you can write your own output builder (instance of DiffOutputBuilderInterface
) and pass to it to the constructor of Differ
and use the Differ::diff
method.
If you're thinking about a CI or something like that maybe you can use diffstat
(https://linux.die.net/man/1/diffstat). This ships with most major linux flavors. So create the diff using the StrictUnifiedDiffOutputBuilder
and feed the result to the command.
I'm not 100% sure this FR fits in the scope of the project, but I think it could technically be done here if we would know the wanted output format.
This is outside the scope of this project.
Okay, thanks for the response. Do you know if something like this is calculated anywhere in PHPUnit already?
Thanks @spacepossum, missed your answer until just now! Good starting places.
I would like to be able to indicate (similar to
GitHub) the relative amount a file has changed. I could not find any convenient way to do that currently, other than creating a diff string and calculating the size of the changes. I think it would make a nice addition to this library.git