Skip to content

Commit

Permalink
refactor: add newline in AppendContent function
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed Jan 14, 2023
1 parent a08ad7e commit 7821ef8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/generator/changelog_generator.go
Expand Up @@ -21,7 +21,7 @@ func formatCommit(c *semrel.Commit) string {
if c.Scope != "" {
ret += fmt.Sprintf("**%s:** ", c.Scope)
}
ret += fmt.Sprintf("%s (%s)\n", c.Message, trimSHA(c.SHA))
ret += fmt.Sprintf("%s (%s)", c.Message, trimSHA(c.SHA))
return ret
}

Expand Down Expand Up @@ -61,7 +61,7 @@ func (g *DefaultChangelogGenerator) Generate(changelogConfig *generator.Changelo
break
}
if commit.Change != nil && commit.Change.Major {
bc := fmt.Sprintf("%s```\n%s\n```\n", formatCommit(commit), strings.Join(commit.Raw[1:], "\n"))
bc := fmt.Sprintf("%s\n```\n%s\n```", formatCommit(commit), strings.Join(commit.Raw[1:], "\n"))
clTypes.AppendContent("%%bc%%", bc)
continue
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/generator/changelog_types.go
Expand Up @@ -18,14 +18,14 @@ func NewChangelogTypes() ChangelogTypes {
func (ct *ChangelogTypes) AppendContent(cType, content string) {
for i, cct := range *ct {
if cct.Type == cType {
(*ct)[i].Content += content
(*ct)[i].Content += content + "\n"
return
}
}
*ct = append(*ct, ChangelogType{
Type: cType,
Text: cType,
Content: content,
Content: content + "\n",
})
}

Expand Down

0 comments on commit 7821ef8

Please sign in to comment.