From 3fa602cc8eeb61ad2993cc80983894b10d5992a7 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 5 Oct 2026 13:21:06 +0200 Subject: [PATCH 1/2] Join a block comment onto the else/elseif it precedes 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. --- blink/internal/fixer/rules/constructs.go | 10 +++++++++- blink/internal/fixer/rules/constructs_config_test.go | 2 ++ blink/internal/fixer/rules/gen_arrays.go | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/blink/internal/fixer/rules/constructs.go b/blink/internal/fixer/rules/constructs.go index dde73cf984..1137602b12 100644 --- a/blink/internal/fixer/rules/constructs.go +++ b/blink/internal/fixer/rules/constructs.go @@ -134,7 +134,15 @@ func (f SingleSpaceAroundConstruct) fixPreceded(s *tokens.Stream) bool { } prev := s.At(i - 1) if prev.Kind == token.Whitespace { - if !hasNewline(prev.Value) && prev.Value != " " { + if !hasNewline(prev.Value) { + if prev.Value != " " { + s.SetValue(i-1, " ") + changed = true + } + } else if p := i - 2; p >= 0 && isBlockOrDocComment(s.At(p)) { + // a block/doc comment directly before the construct joins it onto the + // comment's closing line ("*/ elseif"); php-cs-fixer collapses the + // whitespace unless a "//"/"#" line comment precedes (code cannot follow) s.SetValue(i-1, " ") changed = true } diff --git a/blink/internal/fixer/rules/constructs_config_test.go b/blink/internal/fixer/rules/constructs_config_test.go index a4dca68ae7..9c4b29f878 100644 --- a/blink/internal/fixer/rules/constructs_config_test.go +++ b/blink/internal/fixer/rules/constructs_config_test.go @@ -12,6 +12,8 @@ func TestConstructsConfigCases(t *testing.T) { {"followed default", SingleSpaceAroundConstruct{}, "= 0 && i < s.Len() && isComment(s.At(i)) } +// isBlockOrDocComment reports whether t is a "/* */" block comment or a "/** */" +// doc comment (not a "//"/"#" line comment and not a "#[...]" attribute). +func isBlockOrDocComment(t token.Token) bool { + if t.Kind == token.DocComment { + return true + } + return t.Kind == token.Comment && strings.HasPrefix(t.Value, "/*") +} + func isLineComment(t token.Token) bool { if t.Kind != token.Comment { return false From 8b07f368c8f5b30d8c7a7fec5c2d3e5b16968b1f Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 5 Oct 2026 13:21:58 +0200 Subject: [PATCH 2/2] Ratchet mautic parity gate to 0.25% --- .github/workflows/blink_parity_mautic.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/blink_parity_mautic.yaml b/.github/workflows/blink_parity_mautic.yaml index ef3e8f80e7..e84c4d7d96 100644 --- a/.github/workflows/blink_parity_mautic.yaml +++ b/.github/workflows/blink_parity_mautic.yaml @@ -95,7 +95,7 @@ jobs: - name: Compare the two trees run: | # ratchet gate: fail once the differing share crosses this; lower it as parity improves - MAX_DIFF_PERCENT=0.3 + MAX_DIFF_PERCENT=0.25 total=0 differ=0 differing_files=""