mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 05:24:22 +01:00
fix(config): extend allowlist & handle extend when validating (#1524)
This commit is contained in:
1 parent
989ef19fb0
commit
ed19c4e8b4
8 files changed
+119
-22
No files matched your search
+3
-5
@@ -60,12 +60,10 @@ func (r Rule) Validate() error {
|
||||
return fmt.Errorf("rule |id| is missing or empty" + context)
|
||||
}
|
||||
|
||||
// TODO: uncomment this once it works with |extend|.
|
||||
// See: https://github.com/gitleaks/gitleaks/issues/1507#issuecomment-2352559213
|
||||
// Ensure the rule actually matches something.
|
||||
//if r.Regex == nil && r.Path == nil {
|
||||
// return fmt.Errorf("%s: both |regex| and |path| are empty, this rule will have no effect", r.RuleID)
|
||||
//}
|
||||
if r.Regex == nil && r.Path == nil {
|
||||
return fmt.Errorf("%s: both |regex| and |path| are empty, this rule will have no effect", r.RuleID)
|
||||
}
|
||||
|
||||
// Ensure |secretGroup| works.
|
||||
if r.Regex != nil && r.SecretGroup > r.Regex.NumSubexp() {
|
||||
|
||||
Reference in new issue
Block a user