Repository navigation
Blink parity: honor order option in OrderedClassElements; gate to 0.2% - #140
Merged
Merged
Conversation
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.
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.
Makes OrderedClassElements honor its
orderconfig. Measured drop: 10 to 8 differing files of 4527 (0.18%), 2 files fixed with zero regressions - now under 0.2%.The issue
blink's OrderedClassElements ignored its configuration and always applied the full default grouping (trait use, constants, properties, methods). The mautic config sets
order: ["use_trait"](group trait uses first, leave everything else in source order), so blink wrongly moved a property below a constant:The fix
WithConfigranks each group from theorderlist: a listed group keeps its index, every unlisted group shares the next index (count(order)). A stable sort by rank then moves only the listed groups and leaves the rest in source order - matching php-cs-fixer'sconfigurePostNormalisation(listed types get their position, unlisted collapse tolastPosition, stable sort withsort_algorithm: none). Unconfigured behavior is unchanged (the default group order).Gate
MAX_DIFF_PERCENTlowered 0.25 to 0.2; actual is 0.18% (8 of 4527).Fixed: DncSearchFunctionalTest, LeadFieldRepositoryFunctionalTest. Unit test covers order=["use_trait"] (only trait moves, const stays after property) and the no-trait no-op. Full blink suite, go vet, golangci-lint green; strict rector-src 1:1 gate stays 0-diff.