feat: remove scope and description in conventional commit
parent
e6ecf05dd8
commit
063680ab31
|
@ -107,10 +107,6 @@ func (a *action) getConventionalCommits(c *cli.Context, commits []git.Commit) []
|
|||
return conventionalCommits
|
||||
}
|
||||
|
||||
func (a *action) generateMarkdown(c *cli.Context, commits []convention.Commit) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *action) log(format string, v ...interface{}) {
|
||||
if a.verbose {
|
||||
log.Printf(format, v...)
|
||||
|
|
|
@ -20,10 +20,8 @@ func TestMarkdownGeneratorGetLines(t *testing.T) {
|
|||
name: "1 commit feat",
|
||||
commits: []convention.Commit{
|
||||
{
|
||||
RawHeader: "feat: description",
|
||||
Type: convention.FeatType,
|
||||
Scope: "",
|
||||
Description: "description",
|
||||
RawHeader: "feat: description",
|
||||
Type: convention.FeatType,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -31,10 +29,8 @@ func TestMarkdownGeneratorGetLines(t *testing.T) {
|
|||
name: "1 commit fixed",
|
||||
commits: []convention.Commit{
|
||||
{
|
||||
RawHeader: "fix: description",
|
||||
Type: convention.FixType,
|
||||
Scope: "",
|
||||
Description: "description",
|
||||
RawHeader: "fix: description",
|
||||
Type: convention.FixType,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -42,10 +38,8 @@ func TestMarkdownGeneratorGetLines(t *testing.T) {
|
|||
name: "1 commit other",
|
||||
commits: []convention.Commit{
|
||||
{
|
||||
RawHeader: "ci: description",
|
||||
Type: convention.CiType,
|
||||
Scope: "",
|
||||
Description: "description",
|
||||
RawHeader: "ci: description",
|
||||
Type: convention.CiType,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -53,28 +47,20 @@ func TestMarkdownGeneratorGetLines(t *testing.T) {
|
|||
name: "mixed",
|
||||
commits: []convention.Commit{
|
||||
{
|
||||
RawHeader: "feat: description feat",
|
||||
Type: convention.FeatType,
|
||||
Scope: "",
|
||||
Description: "description feat",
|
||||
RawHeader: "feat: description feat",
|
||||
Type: convention.FeatType,
|
||||
},
|
||||
{
|
||||
RawHeader: "fix: description fix",
|
||||
Type: convention.FixType,
|
||||
Scope: "",
|
||||
Description: "description fix",
|
||||
RawHeader: "fix: description fix",
|
||||
Type: convention.FixType,
|
||||
},
|
||||
{
|
||||
RawHeader: "ci: description ci",
|
||||
Type: convention.CiType,
|
||||
Scope: "",
|
||||
Description: "description ci",
|
||||
RawHeader: "ci: description ci",
|
||||
Type: convention.CiType,
|
||||
},
|
||||
{
|
||||
RawHeader: "build: description build",
|
||||
Type: convention.BuildType,
|
||||
Scope: "",
|
||||
Description: "description build",
|
||||
RawHeader: "build: description build",
|
||||
Type: convention.BuildType,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -18,10 +18,8 @@ var (
|
|||
)
|
||||
|
||||
type Commit struct {
|
||||
RawHeader string
|
||||
Type string
|
||||
Scope string
|
||||
Description string
|
||||
RawHeader string
|
||||
Type string
|
||||
}
|
||||
|
||||
func NewCommit(c git.Commit) (result Commit, err error) {
|
||||
|
@ -51,11 +49,5 @@ func parseHeader(header string, commit *Commit) error {
|
|||
|
||||
commit.Type = headerSubmatches[1]
|
||||
|
||||
commit.Scope = headerSubmatches[2]
|
||||
commit.Scope = strings.TrimPrefix(commit.Scope, "(")
|
||||
commit.Scope = strings.TrimSuffix(commit.Scope, ")")
|
||||
|
||||
commit.Description = headerSubmatches[4]
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
{
|
||||
"RawHeader": "docs: correct spelling of CHANGELOG",
|
||||
"Type": "docs",
|
||||
"Scope": "",
|
||||
"Description": "correct spelling of CHANGELOG"
|
||||
"Type": "docs"
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
{
|
||||
"RawHeader": "refactor!: drop support for Node 6",
|
||||
"Type": "refactor",
|
||||
"Scope": "",
|
||||
"Description": "drop support for Node 6"
|
||||
"Type": "refactor"
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
{
|
||||
"RawHeader": "feat(lang): add polish language",
|
||||
"Type": "feat",
|
||||
"Scope": "lang",
|
||||
"Description": "add polish language"
|
||||
"Type": "feat"
|
||||
}
|
Loading…
Reference in New Issue