Validate validates TypeEnumRule
(msg lint.Commit)
| 30 | |
| 31 | // Validate validates TypeEnumRule |
| 32 | func (r *TypeEnumRule) Validate(msg lint.Commit) (*lint.Issue, bool) { |
| 33 | isFound := search(r.Types, msg.Type()) |
| 34 | if isFound { |
| 35 | return nil, true |
| 36 | } |
| 37 | desc := fmt.Sprintf("type '%s' is not allowed, you can use one of %v", msg.Type(), r.Types) |
| 38 | return lint.NewIssue(desc), false |
| 39 | } |