Skip to content

Commit 0240606

Browse files
feat: check parse error and report as lint error
1 parent 0abb734 commit 0240606

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

linter.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ func NewLinter(conf *Config) *Linter {
2222
func (l *Linter) Lint(commitMsg string) (lintReport string, hasError bool, err error) {
2323
msg, err := parser.Parse(commitMsg)
2424
if err != nil {
25+
if parser.IsHeaderErr(err) {
26+
res := NewResult()
27+
// TODO: show more information
28+
res.add(ErrorType, "commit header is not valid")
29+
return l.formReport(msg, res), true, nil
30+
}
2531
return "", false, err
2632
}
2733

0 commit comments

Comments
 (0)