This PR adds two new flags for diffs -- --file-risk-change and --file-risk-increase.
While the former is essentially what diff does right now, it has the distinct difference of filtering out diff reports for modified source and destination files with equal risk scores.
The latter will filter out diff reports for modified source and destination files where the source file risk score is equal to or greater than the destination file risk score.
The filtering occurs before any d.Modified.Set calls and after the d.Added.Set or d.Removed.Set calls in order to preserve unrelated file changes.
I also added four different test cases for each flag --
Source -> Destination Increase
Source -> Destination Decrease
Source -> Destination No change
Source -> Destination Decrease (--file-risk-change) or Increase (--file-risk-increase) for unrelated files
Closes: #500
This PR adds two new flags for diffs --
--file-risk-change
and--file-risk-increase
.While the former is essentially what
diff
does right now, it has the distinct difference of filtering out diff reports for modified source and destination files with equal risk scores.The latter will filter out diff reports for modified source and destination files where the source file risk score is equal to or greater than the destination file risk score.
The filtering occurs before any
d.Modified.Set
calls and after thed.Added.Set
ord.Removed.Set
calls in order to preserve unrelated file changes.I also added four different test cases for each flag --
--file-risk-change
) or Increase (--file-risk-increase
) for unrelated files