Skip to content

Commit

Permalink
feat(add-contain-value-rule): add Value field in That type
Browse files Browse the repository at this point in the history
  • Loading branch information
gafreax committed Nov 16, 2024
1 parent 28d3b96 commit bc02267
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/config/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type That struct {
Folder string `json:"folder" yaml:"folder"`
Recursive bool `json:"recursive" yaml:"recursive"`
Suffix string `json:"suffix" yaml:"suffix"`
Value string `json:"value" yaml:"value"`
}
type Except struct {
Kind string `json:"kind" yaml:"kind"`
Expand Down Expand Up @@ -158,6 +159,9 @@ func applyThats(rb *file.RuleBuilder, ts []That) error {
case "end_with":
rb.That(ft.EndWith(t.Suffix))

case "contain_value":
rb.That(ft.ContainValue(t.Value))

default:
return fmt.Errorf("'%s': %w", t.Kind, ErrUnknonwnThat)
}
Expand Down

0 comments on commit bc02267

Please sign in to comment.