refactor(formatter): simplify the logic for grouping call arguments#17876
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the logic for grouping call arguments in the formatter to use early returns and simplify the code structure. The goal is to avoid redundant calls to can_group_expression_argument by checking it once and branching based on the result.
Changes:
- Refactored
arguments_grouped_layoutto use early returns withcan_group_expression_argumentcheck - Removed
second_can_groupparameter fromshould_group_first_argument - Removed
last_can_group_fnparameter fromshould_group_last_argument_impl - Moved
can_group_expression_argumentcheck outside ofshould_group_last_argument_implto the caller
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
…17876) Pure refactor, early return when possible
690de75 to
6e540bd
Compare

Pure refactor, early return when possible