feat: highlight breaking changes in release notes (#234)

Add a `**BREAKING**` prefix to any entries in the changelog that are
marked as breaking changes.

Closes #225
This commit is contained in:
Julian Tölle 2025-08-23 22:40:28 +02:00 committed by GitHub
parent 5306e2dd35
commit 48b1894cac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View file

@ -1,5 +1,5 @@
{{define "entry" -}}
- {{ if .Scope }}**{{.Scope}}**: {{end}}{{.Description}}
- {{ if .BreakingChange}}**BREAKING**: {{end}}{{ if .Scope }}**{{.Scope}}**: {{end}}{{.Description}}
{{ end }}
{{- if not .Formatting.HideVersionTitle }}

View file

@ -54,6 +54,23 @@ func Test_NewChangelogEntry(t *testing.T) {
want: "## [1.0.0](https://example.com/1.0.0)\n\n### Features\n\n- Foobar!\n",
wantErr: assert.NoError,
},
{
name: "single breaking change",
args: args{
analyzedCommits: []commitparser.AnalyzedCommit{
{
Commit: git.Commit{},
Type: "feat",
Description: "Foobar!",
BreakingChange: true,
},
},
version: "1.0.0",
link: "https://example.com/1.0.0",
},
want: "## [1.0.0](https://example.com/1.0.0)\n\n### Features\n\n- **BREAKING**: Foobar!\n",
wantErr: assert.NoError,
},
{
name: "single fix",
args: args{