Browse Source

Changelog script. Add links to PRs in non-standard sections warning (#5164)

master
Igor Demin 2 weeks ago committed by GitHub
parent
commit
87d79522e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 18
      tools/changelog.main.kts

18
tools/changelog.main.kts

@ -158,17 +158,19 @@ fun getChangelog(firstCommit: String, lastCommit: String, firstVersion: String,
appendLine()
appendLine()
val nonstandardSections = entries.mapNotNull { it.section }.toSet() - standardSections
val nonstandardSubsections = entries.mapNotNull { it.subsection }.toSet() - standardSubsections
if (nonstandardSections.isNotEmpty()) {
println()
println("WARNING! Changelog contains nonstandard sections. Please change them to the standard ones, or enhance the list in the PR template. List:\n${nonstandardSections.joinToString("\n")}")
val nonstandardSectionEntries = entries
.filter {
it.section != null && it.subsection != null
&& it.section !in standardSections && it.subsection !in standardSubsections
}
if (nonstandardSubsections.isNotEmpty()) {
if (nonstandardSectionEntries.isNotEmpty()) {
println()
println("WARNING! Changelog contains nonstandard subsections. Please change them to the standard ones, or enhance the list in the PR template. List:\n${nonstandardSubsections.joinToString("\n")}")
println("WARNING! Changelog contains nonstandard sections. Please change them to the standard ones, or enhance the list in the PR template.")
for (entry in nonstandardSectionEntries) {
println("${entry.section} - ${entry.subsection} in ${entry.link}")
}
}
}
}

Loading…
Cancel
Save