(msg lint.Commit)
| 63 | } |
| 64 | |
| 65 | func (r *ScopeCaseRule) Validate(msg lint.Commit) (*lint.Issue, bool) { |
| 66 | // scope is optional; skip the check when absent |
| 67 | if msg.Scope() == "" { |
| 68 | return nil, true |
| 69 | } |
| 70 | if casing.Check(msg.Scope(), r.Case) { |
| 71 | return nil, true |
| 72 | } |
| 73 | return caseIssue("scope", r.Case), false |
| 74 | } |
| 75 | |
| 76 | // DescriptionCaseRule validates that the commit description (subject) matches a |
| 77 | // given case format. |