ParseAndLint checks the given commitMsg string against rules
(commitMsg string)
| 34 | |
| 35 | // ParseAndLint checks the given commitMsg string against rules |
| 36 | func (l *Linter) ParseAndLint(commitMsg string) (*Result, error) { |
| 37 | if l.isIgnored(commitMsg) { |
| 38 | return newResult(commitMsg), nil |
| 39 | } |
| 40 | |
| 41 | msg, err := l.parser.Parse(commitMsg) |
| 42 | if err != nil { |
| 43 | issues := l.parserErrorRule(commitMsg, err) |
| 44 | return newResult(commitMsg, issues...), nil |
| 45 | } |
| 46 | return l.Lint(msg) |
| 47 | } |
| 48 | |
| 49 | // isIgnored checks if the first line of the commit message |
| 50 | // matches any of the configured ignore patterns |