feat(convention): allow type, scope has digit
parent
92e8014300
commit
e803445987
|
@ -34,6 +34,12 @@ func TestNewCommit(t *testing.T) {
|
|||
Message: "feat(lang): add polish language",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Commit message with scope",
|
||||
c: git.Commit{
|
||||
Message: "feat(bump00): allow bump minor",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Uppercase",
|
||||
c: git.Commit{
|
||||
|
|
|
@ -20,7 +20,8 @@ const (
|
|||
var (
|
||||
ErrEmptyCommit = errors.New("empty commit")
|
||||
|
||||
headerRegex = regexp.MustCompile(`(?P<type>[a-zA-Z]+)(?P<scope>\([a-zA-Z]+\))?(?P<attention>!)?:\s(?P<description>.+)`)
|
||||
// Self build
|
||||
headerRegex = regexp.MustCompile(`(?P<type>[a-zA-Z0-9]+)(?P<scope>\([a-zA-Z0-9]+\))?(?P<attention>!)?:\s(?P<description>.+)`)
|
||||
)
|
||||
|
||||
type OptionFn func(*Commit) error
|
||||
|
|
5
internal/convention/testdata/TestNewCommit/Commit_message_with_scope#01.golden
vendored
Normal file
5
internal/convention/testdata/TestNewCommit/Commit_message_with_scope#01.golden
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"RawHeader": "feat(bump00): allow bump minor (0001-01-01)",
|
||||
"Type": "feat",
|
||||
"Scope": "bump00"
|
||||
}
|
Loading…
Reference in New Issue