(msg lint.Commit)
| 25 | } |
| 26 | |
| 27 | func (r *TypeCharsetRule) Validate(msg lint.Commit) (*lint.Issue, bool) { |
| 28 | invalidChars, isValid := validateCharset(r.Charset, msg.Type()) |
| 29 | if isValid { |
| 30 | return nil, true |
| 31 | } |
| 32 | return lint.NewIssue( |
| 33 | "type can only have chars ["+r.Charset+"]", |
| 34 | "invalid characters ["+invalidChars+"]", |
| 35 | ), false |
| 36 | } |
| 37 | |
| 38 | // ScopeCharsetRule to validate charset of scope |
| 39 | type ScopeCharsetRule struct{ Charset string } |