From 8bed8d32172448e64937d7fd5925f3c0ba4ba36c Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 5 Oct 2026 11:21:22 +0200 Subject: [PATCH 1/2] Break a multiline grouping paren after a boolean operator php-cs-fixer's MethodArgumentSpace processes a "(" unless it directly follows a non-expected keyword, so a grouping paren after "!", "&&" or "||" is treated like an argument list: when multiline it puts the first operand on its own indented line. blink only reflowed call and declaration parens; it now also reflows these boolean grouping parens, matching ECS. --- .../internal/fixer/rules/method_argument_space.go | 15 ++++++++++++++- .../fixer/rules/method_argument_space_test.go | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/blink/internal/fixer/rules/method_argument_space.go b/blink/internal/fixer/rules/method_argument_space.go index c0bdc238ac..08313d7c97 100644 --- a/blink/internal/fixer/rules/method_argument_space.go +++ b/blink/internal/fixer/rules/method_argument_space.go @@ -403,7 +403,7 @@ func reflowMultilineArgs(s *tokens.Stream) bool { if closeIdx < 0 || !argListIsMultiline(s, open, closeIdx) { continue } - if !isCallOrDeclParen(s, open) { + if !isCallOrDeclParen(s, open) && !isGroupingReflowParen(s, open) { continue } if sigNext(s, open) == closeIdx { @@ -416,6 +416,19 @@ func reflowMultilineArgs(s *tokens.Stream) bool { return changed } +// isGroupingReflowParen reports whether the "(" at open is a grouping parenthesis +// after a boolean operator ("!(", "&& (", "|| ("). php-cs-fixer's MethodArgumentSpace +// processes such parens like an argument list and, when multiline, breaks the first +// operand onto its own line. +func isGroupingReflowParen(s *tokens.Stream, open int) bool { + p := sigPrev(s, open) + if p < 0 { + return false + } + t := s.At(p) + return t.Kind == token.Punct && (t.Value == "!" || t.Value == "&&" || t.Value == "||") +} + // isAttributeComment reports whether t is a "#[...]" attribute (the lexer keeps // it as one comment token), as opposed to a "//" or "#" line comment. func isAttributeComment(t token.Token) bool { diff --git a/blink/internal/fixer/rules/method_argument_space_test.go b/blink/internal/fixer/rules/method_argument_space_test.go index 409f3961d7..3e1fd66dfd 100644 --- a/blink/internal/fixer/rules/method_argument_space_test.go +++ b/blink/internal/fixer/rules/method_argument_space_test.go @@ -23,6 +23,10 @@ func TestMethodArgumentSpace(t *testing.T) { {"newline only inside a nested arg is left alone", " Date: Mon, 5 Oct 2026 11:22:21 +0200 Subject: [PATCH 2/2] Ratchet mautic parity gate to 0.5% --- .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 c18b354024..3f61d1805c 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.6 + MAX_DIFF_PERCENT=0.5 total=0 differ=0 differing_files=""