Skip to content

Commit

Permalink
feat: make rule builder return all violations instead of just the one…
Browse files Browse the repository at this point in the history
… that matches the first should
  • Loading branch information
omissis committed Aug 8, 2022
1 parent 97ed085 commit 026e4f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/arch/file/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ func (rb *RuleBuilder) Because(b rule.Because) []rule.Violation {
}

for _, should := range rb.shoulds {
rb.Violations = should.Evaluate(rb)
if len(rb.Violations) > 0 {
return rb.Violations
vs := should.Evaluate(rb)
if len(vs) > 0 {
rb.Violations = append(rb.Violations, vs...)
}
}

return nil
return rb.Violations
}

func (rb *RuleBuilder) GetFiles() []string {
Expand Down

0 comments on commit 026e4f6

Please # to comment.