Apply sets the needed argument for the rule
(setting lint.RuleSetting)
| 19 | |
| 20 | // Apply sets the needed argument for the rule |
| 21 | func (r *TypeEnumRule) Apply(setting lint.RuleSetting) error { |
| 22 | err := setStringArrArg(&r.Types, setting.Argument) |
| 23 | if err != nil { |
| 24 | return errInvalidArg(r.Name(), err) |
| 25 | } |
| 26 | // sorting the string elements for binary search |
| 27 | sort.Strings(r.Types) |
| 28 | return nil |
| 29 | } |
| 30 | |
| 31 | // Validate validates TypeEnumRule |
| 32 | func (r *TypeEnumRule) Validate(msg lint.Commit) (*lint.Issue, bool) { |