refactor(allowlist): use iota for condition (#1569)

This commit is contained in:
Richard Gomez authored and GitHub committed 2024-10-16 14:59:37 -05:00
1 parent 12034a71c5
commit 5c03fa4a3e
4 files changed
+22 -15

No files matched your search

+10 -3
View File
@@ -6,13 +6,20 @@ import (
"strings"
)
type AllowlistMatchCondition string
type AllowlistMatchCondition int
const (
AllowlistMatchOr AllowlistMatchCondition = "OR"
AllowlistMatchAnd = "AND"
AllowlistMatchOr AllowlistMatchCondition = iota
AllowlistMatchAnd
)
func (a AllowlistMatchCondition) String() string {
return [...]string{
"OR",
"AND",
}[a]
}
// Allowlist allows a rule to be ignored for specific
// regexes, paths, and/or commits
type Allowlist struct {