Blink parity: join block comment onto else/elseif; gate to 0.25% - #139
Merged
Merged
Conversation
SingleSpaceAroundConstruct collapses the whitespace before else/elseif/as/
use_lambda to a single space unless a // or # line comment precedes. blink
skipped the collapse whenever the whitespace held a newline, so a block or doc
comment directly before the construct kept it on its own line. Now a block/doc
comment joins the construct onto its closing line ("*/ elseif"), while a line
comment is still left alone.
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.
Joins a block comment onto the control-continuation keyword it precedes. Measured drop: 12 to 10 differing files of 4527 (0.22%), 2 files fixed with zero regressions.
The pattern
When a block comment directly precedes
else/elseif, ECS pulls the keyword onto the comment's closing*/line:blink kept
elseifon its own line.Root cause
Pinned via applied-checkers JSON and a skip-bisect to
SingleSpaceAroundConstructFixer(not ControlStructureContinuationPosition). Itsconstructs_preceded_by_a_single_space(as, else, elseif, use_lambda) collapses the whitespace before the construct to a single space, except when a full-line///#comment precedes it. Block and doc comments are joined.The fix
SingleSpaceAroundConstruct.fixPrecededskipped the collapse whenever the preceding whitespace held a newline. Now, when that newline-whitespace is directly preceded by a block or doc comment, it collapses to a single space (joining*/ elseif). A///#line comment is still left alone, and the plain}\nelsecase is unchanged.Gate
MAX_DIFF_PERCENTlowered 0.3 to 0.25; actual is 0.22% (10 of 4527).Fixed: DsnParser, BodyParser. Unit tests cover block-comment join and line-comment preservation. Full blink suite, go vet, golangci-lint green; strict rector-src 1:1 gate stays 0-diff (14 files spot-checked).