Skip to content

Commit 576fbb8

Browse files
perf: change header regex
remove body, footers regex patterns in header
1 parent c94a13b commit 576fbb8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

parser.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ import (
1313
// <header/summary> ::= <type>, "(", <scope>, ")", ["!"], ":", <whitespace>*, <text> <type>, ["!"], ":", <whitespace>*, <text>
1414
// <type> ::= <any UTF8-octets except newline or parens or ":" or "!:" or whitespace>+
1515
// <scope> ::= <any UTF8-octets except newline or parens>+
16+
// <description> ::= <any UTF8-octets except newline>*
1617

1718
const (
18-
headRegExStr = `^(?P<type>[^\n\(\)(:|!:| )]+)(?:\((?P<scope>[^\n\(\)]+)\))?(?P<breaking>!)?: (?P<description>[^\n]+)(?:\n\s*\n(?P<body>(?:.|\n)*)(?:\n\s+\n(?P<footers>(?:[A-Za-z-]+: (?:.|\n)*)|(?:BREAKING CHANGE: (?:.|\n)*)|(?:[A-Za-z]+ \#(?:.|\n)*)))?)?$`
19+
headRegExStr = `^(?P<type>[^\n\(\)(:|!:| )]+)(?:\((?P<scope>[^\n\(\)]+)\))?(?P<breaking>!)?: (?P<description>[^\n]+)$`
1920
footRegExStr = `^(?:(BREAKING[- ]CHANGE|(?:[A-Za-z-])+): |((?:[A-Za-z-])+) #)(.+)$`
2021
)
2122

0 commit comments

Comments
 (0)