Repository navigation
Join wrapped changelog entries in generated release notes - #98
Subhransu-De wants to merge 3 commits into
Conversation
GitHub release bodies keep single line breaks, so the 100-column changelog rendered each entry broken mid-sentence. release-notes now joins each list item's indented continuation lines, leaving code blocks untouched.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 81dd7c6a73
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if line.trim_start().starts_with("```") { | ||
| in_code = !in_code; | ||
| } | ||
| let continues_item = !in_code | ||
| && line.starts_with(" ") |
There was a problem hiding this comment.
Preserve indented closing fences
When a fenced code block is nested under a changelog bullet, its closing fence is also indented. This loop flips in_code to false before classifying that same line, so the closing delimiter is treated as a continuation and appended to the final code line. The generated release notes then contain an unclosed fence, causing the remainder to render as code; delimiter lines need to be excluded from continuation joining.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in dfa3fa3. A fence line is now classified before the code state flips, so an indented closing fence is never joined onto the code above it. The new test nested_blocks_and_indented_fences_are_kept covers a fenced block nested under a bullet.
Note
From claude-opus-5-5
| } | ||
| let continues_item = !in_code | ||
| && line.starts_with(" ") | ||
| && !line.trim_start().starts_with(['-', '*']) |
There was a problem hiding this comment.
Preserve all nested Markdown list markers
When a changelog entry contains a nested ordered list or a + bullet, these valid Markdown markers pass this exclusion and are appended to the preceding line, flattening the sublist in the generated release notes. Since nested - and * items are deliberately preserved, the continuation classifier should likewise recognize the other list markers instead of treating them as wrapped prose.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in dfa3fa3. An indented line that starts its own Markdown block is no longer joined onto the item above. That covers ordered items (1. and 2)), + bullets, quotes, table rows and headings, alongside - and *. The new test nested_blocks_and_indented_fences_are_kept covers them.
Note
From claude-opus-5-5
A closing fence is now classified before the code state flips, and ordered, plus, quote, table and heading lines start their own block instead of being joined onto the item above.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfa3fa31c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let mut lines: Vec<String> = Vec::new(); | ||
| let mut in_code = false; | ||
| for line in body.lines() { | ||
| let fence = line.trim_start().starts_with("```"); |
There was a problem hiding this comment.
Preserve tilde-fenced code blocks
When a changelog entry uses a valid tilde fence (~~~), this check never enters code-block state, so each two-space-indented code and delimiter line can satisfy continues_item and be collapsed into one line, destroying the fenced block in the generated release notes. Fresh evidence after the earlier fence fix is that the updated check still recognizes only backtick fences; it should recognize tilde fences and their matching closers as well.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c5e31df. Both ``` and ~~~ fences now open a code block, and a block closes only on the same kind of fence that opened it. The new test tilde_fences_are_kept_and_only_close_their_own_kind covers a tilde block that contains a backtick line.
Note
From claude-opus-5-5
Both backtick and tilde fences now open a code block, and only the same kind closes it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5e31df285
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let continues_item = open_fence.is_none() | ||
| && fence.is_none() | ||
| && line.starts_with(" ") | ||
| && !starts_block(line.trim_start()) |
There was a problem hiding this comment.
When a release entry uses an indented Markdown code block—for example, a blank line followed by multiple lines indented six spaces under - Example:—the first code line is retained, but every following code line satisfies continues_item and is appended to the preceding one. This removes the code block's line structure in the published release notes; recognize indented code blocks or restrict joining to the continuation indentation used for prose.
Useful? React with 👍 / 👎.
| || ["- ", "* ", "+ ", "> ", "| ", "#"] | ||
| .iter() | ||
| .any(|marker| line.starts_with(marker)) |
There was a problem hiding this comment.
When a nested table omits the optional space after its opening pipe, such as |Name|Value| followed by |---|---|, neither row matches the "| " marker. The delimiter row is therefore appended to the header row (and the header may also be appended to preceding text), destroying a valid GitHub Markdown table in the generated notes; treat any leading | as a block marker.
Useful? React with 👍 / 👎.
| fn fence_marker(line: &str) -> Option<&'static str> { | ||
| let line = line.trim_start(); | ||
| ["```", "~~~"] | ||
| .into_iter() | ||
| .find(|marker| line.starts_with(marker)) |
There was a problem hiding this comment.
Match complete closing-fence syntax
When a code block uses a four-character outer fence to show a three-character fence, or contains a line such as ```not-a-closer, fence_marker reduces both lines to the same three-character marker and closes the block early. Markdown requires the closing run to be at least as long as the opener and permits only trailing whitespace, so subsequent indented code lines can be joined and the real closer can reopen the state; retain the delimiter length and validate closing-fence syntax.
Useful? React with 👍 / 👎.
What changed
GitHub release bodies keep single line breaks. The changelog is hard-wrapped at 100 columns, so the v0.1.0 release notes broke every entry mid-sentence. I fixed the published v0.1.0 notes by hand, changing whitespace only.
cargo xtask release-notesnow joins each list item's indented continuation lines onto the item, so future releases render correctly. Fenced code blocks are left untouched. CHANGELOG.md itself stays wrapped.Checks
cargo test -p xtask --locked: 11 passed, including the newwrapped_entries_become_single_lines.cargo clippy -p xtask --all-targets --locked -- -D warnings: clean.Note
From claude-opus-5-5