(msg lint.Commit)
| 15 | func (r *HeaderTrimRule) Name() string { return "header-trim" } |
| 16 | func (r *HeaderTrimRule) Apply(_ lint.RuleSetting) error { return nil } |
| 17 | func (r *HeaderTrimRule) Validate(msg lint.Commit) (*lint.Issue, bool) { |
| 18 | h := msg.Header() |
| 19 | if h == strings.TrimSpace(h) { |
| 20 | return nil, true |
| 21 | } |
| 22 | return lint.NewIssue("header must not have leading or trailing whitespace"), false |
| 23 | } |