feat: add RawHeader in conventional commit

main
hau 2020-11-10 15:47:54 +07:00
parent 3ab8e17719
commit 758c5173c8
4 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,7 @@ var (
) )
type Commit struct { type Commit struct {
RawHeader string
Type string Type string
Scope string Scope string
Description string Description string
@ -44,6 +45,8 @@ func parseHeader(header string, commit *Commit) error {
return errors.New("wrong header format") return errors.New("wrong header format")
} }
commit.RawHeader = header
headerSubmatches := headerRegex.FindStringSubmatch(header) headerSubmatches := headerRegex.FindStringSubmatch(header)
commit.Type = headerSubmatches[1] commit.Type = headerSubmatches[1]

View File

@ -1,4 +1,5 @@
{ {
"RawHeader": "docs: correct spelling of CHANGELOG",
"Type": "docs", "Type": "docs",
"Scope": "", "Scope": "",
"Description": "correct spelling of CHANGELOG" "Description": "correct spelling of CHANGELOG"

View File

@ -1,4 +1,5 @@
{ {
"RawHeader": "refactor!: drop support for Node 6",
"Type": "refactor", "Type": "refactor",
"Scope": "", "Scope": "",
"Description": "drop support for Node 6" "Description": "drop support for Node 6"

View File

@ -1,4 +1,5 @@
{ {
"RawHeader": "feat(lang): add polish language",
"Type": "feat", "Type": "feat",
"Scope": "lang", "Scope": "lang",
"Description": "add polish language" "Description": "add polish language"