(commits: ParsedCommit[], renderBullet: (commit: ParsedCommit) => string)
| 358 | } |
| 359 | |
| 360 | function renderSections(commits: ParsedCommit[], renderBullet: (commit: ParsedCommit) => string) { |
| 361 | if (commits.length === 0) { |
| 362 | return "No notable changes were found in the selected commit range."; |
| 363 | } |
| 364 | |
| 365 | return CATEGORY_ORDER.flatMap((category) => { |
| 366 | const commitsInCategory = commits.filter((commit) => commit.category === category); |
| 367 | if (commitsInCategory.length === 0) { |
| 368 | return []; |
| 369 | } |
| 370 | |
| 371 | return [`## ${category}`, "", ...commitsInCategory.map(renderBullet), ""]; |
| 372 | }) |
| 373 | .join("\n") |
| 374 | .trim(); |
| 375 | } |
| 376 | |
| 377 | export function renderCommitBullet(commit: ParsedCommit) { |
| 378 | const scope = commit.scope ? `**${formatScope(commit.scope)}:** ` : ""; |
no outgoing calls
no test coverage detected