fix(formatter): allow parameters to break in angular test wrappers#18060
fix(formatter): allow parameters to break in angular test wrappers#18060graphite-app[bot] merged 1 commit intomainfrom
Conversation
Merge activity
|
There was a problem hiding this comment.
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_wrapperfunction public incall_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 Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
d4a741a to
936d9ae
Compare
…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)
936d9ae to
8da749b
Compare
…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
…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
Summary
inject,async,fakeAsync,waitForAsync) not breaking across lines when they exceed print widthis_angular_test_wrapperpublic and added a check to exclude angular wrappers from the "hug" parameter layoutTest plan
cargo run -p oxc_prettier_conformance -- --filter angularjs_injectpassescargo run -p oxc_prettier_conformance -- --filter angularpasses (all angular test files)cargo test -p oxc_formatterpasses🤖 Generated with Claude Code