Repository navigation
Blink parity: glue by-reference arrow fn space; gate to 0.1% - #143
Merged
Merged
Conversation
FunctionDeclaration with closure_fn_spacing=none removes the whitespace after
the fn keyword, but blink only did so when "(" followed directly. A
by-reference arrow function "fn &() => ..." has the "(" after "&"; blink now
recognizes it and glues "fn&(", matching php-cs-fixer.
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.
Removes the space in a by-reference arrow function. Measured drop: 5 to 4 differing files of 4527 (0.088%).
The fix
FunctionDeclarationFixerwithclosure_fn_spacing=none(the mautic config) clears the whitespace right after thefnkeyword for a lambda, regardless of a following&. blink only did so when(directly followedfn, sofn &()kept its space:fnIsArrowFnnow also recognizes the by-reference formfn &(, so the space is glued.Gate
MAX_DIFF_PERCENTlowered 0.15 to 0.1; actual is 0.088% (4 of 4527).Unit tests cover by-ref glue under
noneand the single-space kept underone. Full blink suite, go vet, golangci-lint green; strict rector-src 1:1 gate stays 0-diff.Remaining 4 (blocked - require ECS-quirk or lexer changes)
T_INLINE_HTMLtoken; matching it means emulating a php-cs-fixer quirk not provably safe for the rector gate.{$...}contents, which blink treats as atomic - a change that ripples across every interpolated string and cannot keep the 1705-file rector gate at 0-diff.