Skip to content

Commit

Permalink
feat: log why false positives are skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
rgmz committed Nov 9, 2024
1 parent 781157a commit 439d517
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/detectors/falsepositives.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ func FilterKnownFalsePositives(ctx context.Context, detector Detector, results [
continue
}

if isFp, _ := isFalsePositive(result); !isFp {
filteredResults = append(filteredResults, result)
if isFp, reason := isFalsePositive(result); isFp {
ctx.Logger().V(4).Info("Skipping false positive", "result", result.Raw, "reason", reason)
continue
}
filteredResults = append(filteredResults, result)
}

return filteredResults
Expand Down

0 comments on commit 439d517

Please sign in to comment.