mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 20:54:22 +01:00
feat: add --ignore-gitleaks-allow cmd flag (#1260)
* feat: add --ignore-gitleaks-allow cmd flag * typo: fix
This commit is contained in:
1 parent
a82ac29976
commit
0d5e46fecb
4 files changed
+13
-1
No files matched your search
+4
-1
@@ -61,6 +61,9 @@ type Detector struct {
|
||||
// NoColor is a flag to disable color output
|
||||
NoColor bool
|
||||
|
||||
// IgnoreGitleaksAllow is a flag to ignore gitleaks:allow comments.
|
||||
IgnoreGitleaksAllow bool
|
||||
|
||||
// commitMap is used to keep track of commits that have been scanned.
|
||||
// This is only used for logging purposes and git scans.
|
||||
commitMap map[string]bool
|
||||
@@ -282,7 +285,7 @@ func (d *Detector) detectRule(fragment Fragment, rule config.Rule) []report.Find
|
||||
}
|
||||
|
||||
if strings.Contains(fragment.Raw[loc.startLineIndex:loc.endLineIndex],
|
||||
gitleaksAllowSignature) {
|
||||
gitleaksAllowSignature) && !d.IgnoreGitleaksAllow {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user