Skip to content

Commit

Permalink
fix(ChangeLogFormatter): Only use commit titles in the changelog (#31)
Browse files Browse the repository at this point in the history
* fix(ChangeLogFormatter): Only use commit titles in the changelog

* chore(SemverSettings): Do not indent lists by default

There is no (visual) need to indent lists, they will render the same in
Markdown wihtout indentation.

* chore: Remove the empty `gradle.properties` file
  • Loading branch information
sschuberth authored Sep 19, 2023
1 parent 569280a commit 0ac61f8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
Empty file removed gradle.properties
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ChangeLogFormatter(private val settings: SemverSettings, private val chang

internal fun formatLog(changeLog: List<Commit>): String {
val groupedByHeading = TreeMap<String, MutableSet<String>>()
changeLog.forEach { addChange(it.text, groupedByHeading) }
changeLog.forEach { addChange(it.text.lineSequence().first(), groupedByHeading) }

val builder = StringBuilder()
addText(builder, HEADER)
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/git/semver/plugin/semver/SemverSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ open class SemverSettings {
ChangeLogFormatter.MISSING_TYPE to "### Other Changes \uD83D\uDCA1",
ChangeLogFormatter.BREAKING_CHANGE to "### Breaking Changes \uD83D\uDEE0",
ChangeLogFormatter.HEADER to "## What's Changed",
ChangeLogFormatter.CHANGE_PREFIX to " - ",
ChangeLogFormatter.CHANGE_PREFIX to "- ",
ChangeLogFormatter.CHANGE_LINE_SEPARATOR to "\n ",
ChangeLogFormatter.CHANGE_POSTFIX to "",
"fix" to "### Bug Fixes \uD83D\uDC1E",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class ChangeLogFormatterTest {
.startsWith("## What's Changed")
.containsOnlyOnce("Bugfix 1")
.contains("### Breaking Changes")
.contains(" - fix(#5)!: A breaking change")
.contains(" more text")
.contains("- fix(#5)!: A breaking change")
.contains("### Bug Fixes")
.contains("- build(deps): A build change")
.contains("- A CI change")
Expand Down

0 comments on commit 0ac61f8

Please sign in to comment.