File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626)
2727
2828var (
29- errHeader = errors .New ("unable to parse commit header" )
30- errNoNewLine = errors .New ("commit description not followed by an empty line" )
29+ errHeader = errors .New ("unable to parse commit header" )
30+ errNoBlankLine = errors .New ("commit description not followed by an empty line" )
3131)
3232
3333// Parse attempts to parse a commit message to a conventional commit
@@ -53,7 +53,7 @@ func Parse(message string) (*Commit, error) {
5353 }
5454 case 1 :
5555 if msgLine != "" {
56- return commit , errNoNewLine
56+ return commit , errNoBlankLine
5757 }
5858 default :
5959 key , value := parseLineAsFooter (msgLine )
@@ -155,3 +155,8 @@ func parseHeader(header string, commit *Commit) error {
155155func IsHeaderErr (err error ) bool {
156156 return errors .Is (err , errHeader )
157157}
158+
159+ // IsNoBlankLineErr checks if given error is no new line error
160+ func IsNoBlankLineErr (err error ) bool {
161+ return errors .Is (err , errNoBlankLine )
162+ }
You can’t perform that action at this time.
0 commit comments