Skip to content

Commit 7821ef8

Browse files
refactor: add newline in AppendContent function
1 parent a08ad7e commit 7821ef8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/generator/changelog_generator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func formatCommit(c *semrel.Commit) string {
2121
if c.Scope != "" {
2222
ret += fmt.Sprintf("**%s:** ", c.Scope)
2323
}
24-
ret += fmt.Sprintf("%s (%s)\n", c.Message, trimSHA(c.SHA))
24+
ret += fmt.Sprintf("%s (%s)", c.Message, trimSHA(c.SHA))
2525
return ret
2626
}
2727

@@ -61,7 +61,7 @@ func (g *DefaultChangelogGenerator) Generate(changelogConfig *generator.Changelo
6161
break
6262
}
6363
if commit.Change != nil && commit.Change.Major {
64-
bc := fmt.Sprintf("%s```\n%s\n```\n", formatCommit(commit), strings.Join(commit.Raw[1:], "\n"))
64+
bc := fmt.Sprintf("%s\n```\n%s\n```", formatCommit(commit), strings.Join(commit.Raw[1:], "\n"))
6565
clTypes.AppendContent("%%bc%%", bc)
6666
continue
6767
}

pkg/generator/changelog_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ func NewChangelogTypes() ChangelogTypes {
1818
func (ct *ChangelogTypes) AppendContent(cType, content string) {
1919
for i, cct := range *ct {
2020
if cct.Type == cType {
21-
(*ct)[i].Content += content
21+
(*ct)[i].Content += content + "\n"
2222
return
2323
}
2424
}
2525
*ct = append(*ct, ChangelogType{
2626
Type: cType,
2727
Text: cType,
28-
Content: content,
28+
Content: content + "\n",
2929
})
3030
}
3131

0 commit comments

Comments
 (0)