mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
refactor(config): use non-capture groups for allowlists (#1735)
Non-capture groups appear to be measurably faster.
This commit is contained in:
1 parent
36c52c6b73
commit
7fc11bb264
7 files changed
+209
-177
No files matched your search
@@ -45,7 +45,7 @@ func KubernetesSecret() *config.Rule {
|
||||
// Avoid overreach between directives.
|
||||
RegexTarget: "match",
|
||||
Regexes: []*regexp.Regexp{
|
||||
regexp.MustCompile(`(kind:(.|\s)+\n---\n(.|\s)+\bdata:|data:(.|\s)+\n---\n(.|\s)+\bkind:)`),
|
||||
regexp.MustCompile(`(kind:(?:.|\s)+\n---\n(?:.|\s)+\bdata:|data:(?:.|\s)+\n---\n(?:.|\s)+\bkind:)`),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user