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