From 2025edb76e257195780e13e198d39e9cc1d55315 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Thu, 11 Jun 2026 17:38:08 +0200 Subject: [PATCH] chore(chnagelog): Rename `message` to `description` This variable should only contain the description part of the commit message title as described at [1]. [1]: https://www.conventionalcommits.org/en/v1.0.0/#summary --- .../git/semver/plugin/changelog/ChangeLogFormatter.kt | 6 +++--- .../kotlin/git/semver/plugin/changelog/ChangeLogTexts.kt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/git/semver/plugin/changelog/ChangeLogFormatter.kt b/src/main/kotlin/git/semver/plugin/changelog/ChangeLogFormatter.kt index 12f5fbe..b50f29d 100644 --- a/src/main/kotlin/git/semver/plugin/changelog/ChangeLogFormatter.kt +++ b/src/main/kotlin/git/semver/plugin/changelog/ChangeLogFormatter.kt @@ -9,7 +9,7 @@ data class ChangeLogFormatter( companion object { private const val SCOPE = "Scope" private const val TYPE = "Type" - private const val MESSAGE = "Message" + private const val DESCRIPTION = "Description" } fun formatLog(changeLog: List, settings: SemverSettings, changeLogTexts: ChangeLogTexts): String { @@ -57,7 +57,7 @@ data class ChangeLogFormatter( isBreakingChange, it.groupValue(TYPE), it.groupValue(SCOPE), - it.groupValue(MESSAGE) + it.groupValue(DESCRIPTION) ) } ?: CommitInfo(commits, text, isBreakingChange) } @@ -70,7 +70,7 @@ data class ChangeLogFormatter( val isBreaking: Boolean, val type: String? = null, val scope: String? = null, - val message: String? = null + val description: String? = null ) class Context { diff --git a/src/main/kotlin/git/semver/plugin/changelog/ChangeLogTexts.kt b/src/main/kotlin/git/semver/plugin/changelog/ChangeLogTexts.kt index 72df790..b9fd828 100644 --- a/src/main/kotlin/git/semver/plugin/changelog/ChangeLogTexts.kt +++ b/src/main/kotlin/git/semver/plugin/changelog/ChangeLogTexts.kt @@ -63,11 +63,11 @@ open class ChangeLogTexts( var sortByText: Boolean = true - var changeLogPattern: String = "(?m)^(?\\w+)(?:\\((?[^()]+)\\))?!?:\\s*(?.*)$" + var changeLogPattern: String = "(?m)^(?\\w+)(?:\\((?[^()]+)\\))?!?:\\s*(?.*)$" var headerFormat: (ChangeLogFormatter.CommitInfo) -> String = { commitInfo -> - (commitInfo.message ?: commitInfo.text).lineSequence().first() + (commitInfo.description ?: commitInfo.text).lineSequence().first() } var fullHeaderFormat: (ChangeLogFormatter.CommitInfo) -> String = { commitInfo -> commitInfo.text.lineSequence().first()