Browse Source

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

master
Igor Demin 1 week 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()
appendLine() appendLine()
val nonstandardSections = entries.mapNotNull { it.section }.toSet() - standardSections val nonstandardSectionEntries = entries
val nonstandardSubsections = entries.mapNotNull { it.subsection }.toSet() - standardSubsections .filter {
it.section != null && it.subsection != null
if (nonstandardSections.isNotEmpty()) { && it.section !in standardSections && it.subsection !in standardSubsections
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")}")
} }
if (nonstandardSubsections.isNotEmpty()) { if (nonstandardSectionEntries.isNotEmpty()) {
println() 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