mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Feat/add fingerprint no git (#952)
* no-git support fingerprint support * updating gitleaksignore w/ no-git false positives * fix test
This commit is contained in:
1 parent
6748a89bf4
commit
1b3f10cb79
4 files changed
+69
-1
No files matched your search
@@ -450,6 +450,11 @@ func (d *Detector) Detect(fragment Fragment) []report.Finding {
|
||||
|
||||
// addFinding synchronously adds a finding to the findings slice
|
||||
func (d *Detector) addFinding(finding report.Finding) {
|
||||
if finding.Commit == "" {
|
||||
finding.Fingerprint = fmt.Sprintf("%s:%s:%d", finding.File, finding.RuleID, finding.StartLine)
|
||||
} else {
|
||||
finding.Fingerprint = fmt.Sprintf("%s:%s:%s:%d", finding.Commit, finding.File, finding.RuleID, finding.StartLine)
|
||||
}
|
||||
// check if we should ignore this finding
|
||||
if _, ok := d.gitleaksIgnore[finding.Fingerprint]; ok {
|
||||
log.Debug().Msgf("ignoring finding with Fingerprint %s",
|
||||
|
||||
Reference in new issue
Block a user