Skip to content

Commit

Permalink
Gradle: patchPluginXml: fix formatting of <change-notes>
Browse files Browse the repository at this point in the history
Commit 1082881 (Gradle: patchPluginXml: link to the full changelog,
2023-07-05) added section "See also" to <change-notes> generated by
Gradle task `patchPluginXml`.  I failed to test the change.  The
asterisk in front of the `[Full changelog](...)` causes the list item to
be nested one level too deep.

Function `plus()` keeps only the `extraItems` passed into the
constructor of `Changelog.Item` (and `summary`, but only if left-hand
side `Item` doesn't have one already).  So we technically could keep the
String "* ", as its value was just ignored by `plus()`.[1]

Remove unnecessary asterisks of Markdown list syntax that I've added
without understanding how the classes Changelog and Changelog.Item work.
While we're here, mention introduction of the "See also" section with
the link to the full changelog in `CHANGELOG.md`.

[1] value of property `itemPrefix` in class Changelog.Item is completely
    unused as of Gradle Changelog Plugin 2.1.1, but that's a separate
    issue
  • Loading branch information
rybak committed Jul 7, 2023
1 parent 785f15b commit e8b75d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Added
- Installation instructions for alpha versions have been added to the
[README](https://github.com/rybak/intellij-copy-commit-reference/blob/main/README.md)
- "What's New" tab for the plugin now includes a link to the full changelog

### Changed
- Example of a commit reference has been added to plugin's public description
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ tasks {
changeNotes = properties("pluginVersion").map { pluginVersion ->
"<h2>${pluginVersion}</h2>\n" + with(changelog) {
val extraItems = mapOf(
"See also" to setOf("* [Full changelog](https://github.com/rybak/intellij-copy-commit-reference/blob/main/CHANGELOG.md)")
"See also" to setOf("[Full changelog](https://github.com/rybak/intellij-copy-commit-reference/blob/main/CHANGELOG.md)")
)
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false)
.plus(Changelog.Item("", "", "", false, extraItems, "* ", "")),
.plus(Changelog.Item("", "", "", false, extraItems, "", "")),
Changelog.OutputType.HTML
)
}
Expand Down

0 comments on commit e8b75d1

Please sign in to comment.