Repository navigation
Ignore a trailing line terminator in comment text [patch] - #173
Merged
matt-edmondson merged 1 commit intoNov 4, 2026
Merged
Conversation
LineTerminators.Split kept the empty tail that a trailing terminator leaves, so a copyright notice ending in a newline got a bare // line before the auto-generated marker, and a one-line doc summary ending in one was laid out over several lines with an empty ///. Drop that one empty tail, as TemplateRendering.SplitLines already does. A blank line inside the text is still written. Fixes #170 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5LkA4KtEKYNbjk5tz
|
matt-edmondson
deleted the
claude/issue-170-drop-trailing-line-terminator
branch
November 4, 2026 00:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #170
Summary
LineTerminators.Splitwas a plainstring.Split, so text ending in a line terminator kept an empty last element, and both of its callers wrote that element as a line:WriteAutoGeneratedHeader("Copyright (c) X\r\n")wrote a bare//between the copyright and// <auto-generated />.DocComment { Summary = "Hello.\n" }split the summary over three lines and added an empty///line, where"Hello."alone gives/// <summary>Hello.</summary>. The same applied to every other element,<param>included.Changes
LineTerminators.Splitdrops one empty trailing element when there is more than one line. This follows the ruleTemplateRendering.SplitLinesalready uses. It recognises every terminator: LF, CRLF, CR, NEL, LS and PS."A\n\nB", is still written as a bare//////, because only the tail is dropped.Array.Resizeinstead oflines[..^1], because the netstandard2.0 target has noRuntimeHelpers.GetSubArray.Tests
//."A\n\nB\n"keeps its inner blank line.Summary = "Hello."followed by LF, CRLF or LS renders on one line.Summary = "A\nB\n"renders two content lines with no empty///.<param>whose text ends in\nrenders on one line.mainand pass with the fix. I checked this by revertingLineTerminators.csand running them again.Generated by Claude Code