diff --git a/cmd/main.go b/cmd/main.go index 5d3031e..92e91e5 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -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...) diff --git a/pkg/changelog/markdown_test.go b/pkg/changelog/markdown_test.go index ffd9d94..37b0525 100644 --- a/pkg/changelog/markdown_test.go +++ b/pkg/changelog/markdown_test.go @@ -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, }, }, }, diff --git a/pkg/convention/commit.go b/pkg/convention/commit.go index 1f87122..739b327 100644 --- a/pkg/convention/commit.go +++ b/pkg/convention/commit.go @@ -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 } diff --git a/pkg/convention/testdata/TestNewCommit/Commit_message_with_no_body.golden b/pkg/convention/testdata/TestNewCommit/Commit_message_with_no_body.golden index d2adbf8..31397b5 100644 --- a/pkg/convention/testdata/TestNewCommit/Commit_message_with_no_body.golden +++ b/pkg/convention/testdata/TestNewCommit/Commit_message_with_no_body.golden @@ -1,6 +1,4 @@ { "RawHeader": "docs: correct spelling of CHANGELOG", - "Type": "docs", - "Scope": "", - "Description": "correct spelling of CHANGELOG" + "Type": "docs" } \ No newline at end of file diff --git a/pkg/convention/testdata/TestNewCommit/Commit_message_with_not_character_to_draw_attention_to_breaking_change.golden b/pkg/convention/testdata/TestNewCommit/Commit_message_with_not_character_to_draw_attention_to_breaking_change.golden index e0cec80..1c95e9b 100644 --- a/pkg/convention/testdata/TestNewCommit/Commit_message_with_not_character_to_draw_attention_to_breaking_change.golden +++ b/pkg/convention/testdata/TestNewCommit/Commit_message_with_not_character_to_draw_attention_to_breaking_change.golden @@ -1,6 +1,4 @@ { "RawHeader": "refactor!: drop support for Node 6", - "Type": "refactor", - "Scope": "", - "Description": "drop support for Node 6" + "Type": "refactor" } \ No newline at end of file diff --git a/pkg/convention/testdata/TestNewCommit/Commit_message_with_scope.golden b/pkg/convention/testdata/TestNewCommit/Commit_message_with_scope.golden index 5e56feb..0921d71 100644 --- a/pkg/convention/testdata/TestNewCommit/Commit_message_with_scope.golden +++ b/pkg/convention/testdata/TestNewCommit/Commit_message_with_scope.golden @@ -1,6 +1,4 @@ { "RawHeader": "feat(lang): add polish language", - "Type": "feat", - "Scope": "lang", - "Description": "add polish language" + "Type": "feat" } \ No newline at end of file