Closed johnlk closed 5 months ago
Could we have two settings:
ignore_file_deletions
: Ignore lines from only deleted files but count deleted lines from modified files.ignore_line_deletions
: ignore all the deleted lines. This would be super set of ignore_file_deletions
which would ignore deleted files from all kinds of modifications.Depending on the project, line deletions from modified files does require review efforts, so we do need to count lines from modified files but not from deleted files. In such case ignore_line_deletions
won't cut it and ignore_file_deletions
would be more precise.
Could we have two settings:
ignore_file_deletions
: Ignore lines from only deleted files but count deleted lines from modified files.ignore_line_deletions
: ignore all the deleted lines. This would be super set ofignore_file_deletions
which would ignore deleted files from all kinds of modifications.Depending on the project, line deletions from modified files does require review efforts, so we do need to count lines from modified files but not from deleted files. In such case
ignore_line_deletions
won't cut it andignore_file_deletions
would be more precise.
Thanks for the feedback, I think this is a great distinction and something I can incorporate. I could see why ignoring file deletions alone could prove valuable.
@OnkarRuikar to prevent this PR from getting any larger, I'm going to implement the ignore_file_deletions
option in a followup PR.
This current change has test updates, refactoring, and a new feature, so I want to stop here for now.
What type of PR is this? (check all applicable)
Description
Some users prefer to not include file line deletions in the total line change count. I'm allowing this by way of a new config variable
ignore_line_deletions
which defaults tofalse
.By request I may add another variable
ignore_file_deletions
which would not count files which are completely deleted. This will most likely come as a followup change.Notes to Reviewer
This required I break up the
changes
variable in the PR files loop intoadditions
anddeletions
. This makes the code more consistent between the if and else blocks in thecalculate_total_modifications
method.How to test
I ensured that all four possible code paths were tested.
files_to_ignore
(set or not) xignore_line_deletions
(true/false).In the process of adding these tests, I added an example response for the pull request API. This was missing.
Link to issues addressed