Skip to content

fix(formatter): allow parameters to break in angular test wrappers#18060

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix/formatter-angular-test-wrapper-params
Jan 16, 2026
Merged

fix(formatter): allow parameters to break in angular test wrappers#18060
graphite-app[bot] merged 1 commit intomainfrom
fix/formatter-angular-test-wrapper-params

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Jan 16, 2026

Summary

  • Fixed function parameters inside angular test wrappers (inject, async, fakeAsync, waitForAsync) not breaking across lines when they exceed print width
  • Made is_angular_test_wrapper public and added a check to exclude angular wrappers from the "hug" parameter layout
  • JS conformance improved from 96.85% to 96.98%

Test plan

  • cargo run -p oxc_prettier_conformance -- --filter angularjs_inject passes
  • cargo run -p oxc_prettier_conformance -- --filter angular passes (all angular test files)
  • cargo test -p oxc_formatter passes

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings January 16, 2026 06:49
@Boshen Boshen requested a review from Dunqing as a code owner January 16, 2026 06:49
@github-actions github-actions bot added A-formatter Area - Formatter C-bug Category - Bug labels Jan 16, 2026
Copy link
Member

@Dunqing Dunqing left a comment

Choose a reason for hiding this comment

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

Nice!

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Jan 16, 2026
Copy link
Member

Dunqing commented Jan 16, 2026

Merge activity

  • Jan 16, 6:51 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 16, 7:00 AM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
  • Jan 16, 7:00 AM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..
  • Jan 16, 7:00 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 16, 7:41 AM UTC: Dunqing added this pull request to the Graphite merge queue.
  • Jan 16, 7:47 AM UTC: Merged by the Graphite merge queue.

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 fixes a formatting issue where function parameters inside Angular test wrappers (inject, async, fakeAsync, waitForAsync) were not breaking across lines when they exceeded the print width. The fix involves making the is_angular_test_wrapper function public and adding a check to exclude Angular wrappers from the "hug" parameter layout, allowing their inner function parameters to break normally.

Changes:

  • Made is_angular_test_wrapper function public in call_expression.rs
  • Added logic to exclude Angular test wrappers from parameter hugging in parameters.rs
  • Improved JS/TS conformance test results (removed 2 failing TS test files and 1 failing JS test file)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
crates/oxc_formatter/src/utils/call_expression.rs Made is_angular_test_wrapper function public for use in parameter formatting
crates/oxc_formatter/src/print/parameters.rs Added import and logic to exclude Angular test wrappers from parameter hugging, allowing their parameters to break
tasks/prettier_conformance/snapshots/prettier.js.snap.md Updated JS conformance stats showing angularjs_inject.js test now passes
tasks/prettier_conformance/snapshots/prettier.ts.snap.md Updated TS conformance stats removing two previously failing union comment tests

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

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 16, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing fix/formatter-angular-test-wrapper-params (1eaa955) with main (f69b6da)

Summary

✅ 38 untouched benchmarks
⏩ 7 skipped benchmarks1

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.

@Boshen Boshen force-pushed the fix/formatter-angular-test-wrapper-params branch 2 times, most recently from d4a741a to 936d9ae Compare January 16, 2026 07:33
…18060)

## Summary

- Fixed function parameters inside angular test wrappers (`inject`, `async`, `fakeAsync`, `waitForAsync`) not breaking across lines when they exceed print width
- Made `is_angular_test_wrapper` public and added a check to exclude angular wrappers from the "hug" parameter layout
- JS conformance improved from 96.85% to 96.98%

## Test plan

- [x] `cargo run -p oxc_prettier_conformance -- --filter angularjs_inject` passes
- [x] `cargo run -p oxc_prettier_conformance -- --filter angular` passes (all angular test files)
- [x] `cargo test -p oxc_formatter` passes

🤖 Generated with [Claude Code](https://claude.ai/code)
@graphite-app graphite-app bot force-pushed the fix/formatter-angular-test-wrapper-params branch from 936d9ae to 8da749b Compare January 16, 2026 07:41
@graphite-app graphite-app bot merged commit 8da749b into main Jan 16, 2026
21 checks passed
@graphite-app graphite-app bot deleted the fix/formatter-angular-test-wrapper-params branch January 16, 2026 07:47
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 16, 2026
JoviDeCroock pushed a commit to JoviDeCroock/oxc that referenced this pull request Jan 16, 2026
…xc-project#18060)

- Fixed function parameters inside angular test wrappers (`inject`, `async`, `fakeAsync`, `waitForAsync`) not breaking across lines when they exceed print width
- Made `is_angular_test_wrapper` public and added a check to exclude angular wrappers from the "hug" parameter layout
- JS conformance improved from 96.85% to 96.98%

- [x] `cargo run -p oxc_prettier_conformance -- --filter angularjs_inject` passes
- [x] `cargo run -p oxc_prettier_conformance -- --filter angular` passes (all angular test files)
- [x] `cargo test -p oxc_formatter` passes

🤖 Generated with [Claude Code](https://claude.ai/code)

Add support for no constructed context values

[autofix.ci] apply automated fixes

Add support for no constructed context values

[autofix.ci] apply automated fixes

Fix duplicate export
JoviDeCroock pushed a commit to JoviDeCroock/oxc that referenced this pull request Jan 16, 2026
…xc-project#18060)

- Fixed function parameters inside angular test wrappers (`inject`, `async`, `fakeAsync`, `waitForAsync`) not breaking across lines when they exceed print width
- Made `is_angular_test_wrapper` public and added a check to exclude angular wrappers from the "hug" parameter layout
- JS conformance improved from 96.85% to 96.98%

- [x] `cargo run -p oxc_prettier_conformance -- --filter angularjs_inject` passes
- [x] `cargo run -p oxc_prettier_conformance -- --filter angular` passes (all angular test files)
- [x] `cargo test -p oxc_formatter` passes

🤖 Generated with [Claude Code](https://claude.ai/code)

Add support for no constructed context values

[autofix.ci] apply automated fixes

Add support for no constructed context values

[autofix.ci] apply automated fixes

Fix duplicate export
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants