(msg lint.Commit)
| 53 | } |
| 54 | |
| 55 | func (r *TrailerExistsRule) Validate(msg lint.Commit) (*lint.Issue, bool) { |
| 56 | if hasTrailer(msg, r.Value) { |
| 57 | return nil, true |
| 58 | } |
| 59 | return lint.NewIssue("message must contain trailer " + r.Value), false |
| 60 | } |
| 61 | |
| 62 | func hasTrailer(msg lint.Commit, token string) bool { |
| 63 | for i := 0; i < msg.NoteCount(); i++ { |