Skip to content

fix(release): no blank line between changelog entries after a fold or a fragment collect - #708

Merged
leemour merged 1 commit into
mainfrom
fix/changelog-fold-blank-line
Nov 23, 2026
Merged

leemour merged 1 commit into
mainfrom
fix/changelog-fold-blank-line

Conversation

@leemour

@leemour leemour commented Nov 23, 2026

Copy link
Copy Markdown
Member

Task

bin/release folds changes/*.md fragments (and an ## Unreleased body) into the dated version's section. The result could carry a wrong blank line.

Why

Seen in ydisk-cli 0.3.0: the fragment changes/feat-mirrors.md had a blank line between two ### Fixed entries, and collectFragments copied it, so the released Fixed list was split in two (fixed by hand in ydisk 291fb2d). A second case: when the dated section repeats a ### heading (a PR branched before the fold, applied by git under the dated heading), collectFragments trimmed only the ends of the joined body, so two blank lines in a row stayed between the copies.

What

  • joinBodies in src/release/fold.ts: trims each body of a heading, then drops a blank line that comes right before a - entry. A blank line inside an entry, before its indented next paragraph, stays.
  • foldUnreleased, mergeRepeatedHeadings and collectFragments use it; the copy of trimBlank in fragments.ts is gone.

Testing

  • New tests fail before the change and pass after: one fragment, several fragments with the same and different headings, a blank line inside a fragment, a repeated heading in the dated section, an Unreleased body with a blank between entries, the dated section last in the file. Existing tests cover an empty Unreleased.
  • pnpm typecheck, pnpm lint, pnpm docs:check, vitest run src/release src/dev (287 tests) pass locally.

🤖 Generated with Claude Code

… a fragment collect

collectFragments kept the blank lines inside a fragment's body and between two
copies of the same ### heading in the dated section. A blank line before "- "
split one list in two (ydisk 0.3.0's Fixed), and a repeated heading left two
blank lines in a row. foldUnreleased had the same gap for an Unreleased body.

Both now join a heading's bodies with joinBodies: each body trimmed, and a blank
line kept only inside an entry, before its indented next paragraph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit 5272b58 into main Nov 23, 2026
10 checks passed
@leemour
leemour deleted the fix/changelog-fold-blank-line branch November 23, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant