-
Notifications
You must be signed in to change notification settings - Fork 4
Add newlines after sections #498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis pull request makes two primary modifications. In the test suite ( Changes
Sequence Diagram(s)sequenceDiagram
participant U as User Input
participant R as rebuildMarkdown
participant F as Formatter Logic
participant O as Output Markdown
U->>R: Provide raw markdown content
R->>F: Process first section header and content
F-->>R: Return section with proper newlines
R->>F: Process subsequent sections (check lastSectionIndex)
F-->>R: Append necessary newline gaps
R->>R: Trim trailing blank lines from result
R-->>O: Output final formatted markdown
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
🔇 Additional comments (7)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This pull request improves how markdown release notes are formatted by inserting blank lines between sections and updating the parameter controlling collapsed content in release notes.
- Updated the collapse threshold from 3 to 5 in the tests to adjust summarization behavior.
- Modified the rebuildMarkdown function to track section boundaries and ensure proper blank lines are inserted between sections.
Reviewed Changes
File | Description |
---|---|
src/notes.ts | Added logic for tracking section indices and inserting/removing blank lines. |
tests/notes.test.ts | Updated the collapseAfter parameter for release notes generation. |
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/notes.ts:131
- [nitpick] Consider adding unit tests that specifically verify the behavior of newline insertion between sections, ensuring that sections with and without final blank lines are correctly handled.
let lastSectionIndex = -1
4e4b072
to
4a20748
Compare
This pull request includes changes to the
generateReleaseNotes
function and improvements to therebuildMarkdown
function to handle section processing more effectively. The most important changes include adjusting the collapse threshold for release notes and ensuring proper formatting with blank lines between sections.Changes to
generateReleaseNotes
function:__tests__/notes.test.ts
: Updated thecollapseAfter
parameter from 3 to 5 to control the number of items shown before collapsing.Improvements to
rebuildMarkdown
function:src/notes.ts
: Added tracking of the last processed section index to insert newlines between sections.src/notes.ts
: Modified the logic to handle section headers and bullet points more accurately by using trimmed lines and ensuring blank lines are added after sections. [1] [2]src/notes.ts
: Ensured there are no trailing blank lines at the end of the processed markdown.Summary by CodeRabbit