From 6454f2c1f775ea2e3b4e935294e01d308fa8e4a8 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 5 Oct 2026 13:42:28 +0200 Subject: [PATCH] Honor the order option in OrderedClassElements; gate to 0.2% OrderedClassElements ignored its "order" config and always applied the full default grouping, reordering const/property even when the mautic config orders only ["use_trait"]. WithConfig now ranks each group from the order list (a listed group keeps its index, unlisted groups share the next index) and a stable sort moves only the listed groups, leaving the rest in source order. --- .github/workflows/blink_parity_mautic.yaml | 2 +- .../fixer/rules/class_notation_test.go | 25 +++++++ .../fixer/rules/ordered_class_elements.go | 65 +++++++++++++++---- 3 files changed, 80 insertions(+), 12 deletions(-) diff --git a/.github/workflows/blink_parity_mautic.yaml b/.github/workflows/blink_parity_mautic.yaml index e84c4d7d96..05d928cdf8 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.25 + MAX_DIFF_PERCENT=0.2 total=0 differ=0 differing_files="" diff --git a/blink/internal/fixer/rules/class_notation_test.go b/blink/internal/fixer/rules/class_notation_test.go index 7462c5db2d..506c863613 100644 --- a/blink/internal/fixer/rules/class_notation_test.go +++ b/blink/internal/fixer/rules/class_notation_test.go @@ -56,6 +56,31 @@ func TestOrderedClassElementsSimple(t *testing.T) { } } +func TestOrderedClassElementsOrderUseTraitOnly(t *testing.T) { + // order ["use_trait"] groups trait uses first and leaves every other member + // in its source order (const stays after the property here) + src := "