Skip to content

refactor(formatter): improve the code that was made for removing the binding pattern#17277

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-22-refactor_formatter_improve_the_code_that_was_made_for_removing_the_binding_pattern
Dec 23, 2025
Merged

refactor(formatter): improve the code that was made for removing the binding pattern#17277
graphite-app[bot] merged 1 commit intomainfrom
12-22-refactor_formatter_improve_the_code_that_was_made_for_removing_the_binding_pattern

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Dec 22, 2025

Follow up on #15925. Improved slightly to make it simpler.

@github-actions github-actions bot added A-formatter Area - Formatter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Dec 22, 2025
Copy link
Member Author

Dunqing commented Dec 22, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@Dunqing Dunqing marked this pull request as ready for review December 22, 2025 14:16
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 22, 2025

CodSpeed Performance Report

Merging #17277 will not alter performance

Comparing 12-22-refactor_formatter_improve_the_code_that_was_made_for_removing_the_binding_pattern (08d1615) with main (7074353)

Summary

✅ 38 untouched
⏩ 7 skipped1

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the formatter code that handles function parameter formatting, improving code clarity and maintainability. The changes follow up on PR #15925 and simplify the implementation without changing behavior.

  • Refactored FormalParameter formatting to use memoization for better comment handling
  • Extracted common logic into a reusable is_huggable_expression helper function
  • Simplified field access patterns by removing unnecessary method calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you 🙏

Copy link
Member

@leaysgur leaysgur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, Prettier does not have tests for !... 👀

@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Dec 23, 2025
Copy link
Member

leaysgur commented Dec 23, 2025

Merge activity

graphite-app bot pushed a commit that referenced this pull request Dec 23, 2025
…binding pattern (#17277)

Follow up on #15925. Improved slightly to make it simpler.
@graphite-app graphite-app bot force-pushed the 12-22-refactor_formatter_improve_the_code_that_was_made_for_removing_the_binding_pattern branch from a16a902 to cd069c0 Compare December 23, 2025 02:24
@Dunqing Dunqing force-pushed the 12-22-refactor_formatter_improve_the_code_that_was_made_for_removing_the_binding_pattern branch from cd069c0 to 28ee9a8 Compare December 23, 2025 02:27
…binding pattern (#17277)

Follow up on #15925. Improved slightly to make it simpler.
@graphite-app graphite-app bot force-pushed the 12-22-refactor_formatter_improve_the_code_that_was_made_for_removing_the_binding_pattern branch from 28ee9a8 to bde0769 Compare December 23, 2025 02:27
@Dunqing
Copy link
Member Author

Dunqing commented Dec 23, 2025

Oh, Prettier does not have tests for !... 👀

Yes, it's surprised me, and I found another regression from https://github.com/oxc-project/oxc-ecosystem-ci/actions/runs/20449000316/job/58758212726, which fixed in 28ee9a8

@graphite-app graphite-app bot merged commit bde0769 into main Dec 23, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 12-22-refactor_formatter_improve_the_code_that_was_made_for_removing_the_binding_pattern branch December 23, 2025 02:33
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants