(msg lint.Commit)
| 47 | } |
| 48 | |
| 49 | func (r *BodyFullStopRule) Validate(msg lint.Commit) (*lint.Issue, bool) { |
| 50 | body := msg.Body() |
| 51 | if body == "" { |
| 52 | return nil, true |
| 53 | } |
| 54 | if !strings.HasSuffix(body, r.Char) { |
| 55 | return nil, true |
| 56 | } |
| 57 | return lint.NewIssue(fmt.Sprintf("body must not end with %q", r.Char)), false |
| 58 | } |
| 59 | |
| 60 | // DescriptionFullStopRule checks that the description does NOT end with a given character. |
| 61 | type DescriptionFullStopRule struct{ Char string } |