Skip to content

fix(oxfmt): Do not wrap with block_indent() if format_embedded fails#17975

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-14-fix_oxfmt_do_not_wrap_with_indent_if_format_embedded_fails
Jan 14, 2026
Merged

fix(oxfmt): Do not wrap with block_indent() if format_embedded fails#17975
graphite-app[bot] merged 1 commit intomainfrom
01-14-fix_oxfmt_do_not_wrap_with_indent_if_format_embedded_fails

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Jan 14, 2026

Fixes #17948 and may fix next.js repo diffs. => Confirmed all xxx-in-js diffs are resolved ✨


When Prettier fails to format embedded code (e.g., valid css tag but with invalid content), the previous implementation returned the original code as a successful result.

This caused issues because block_indent is always added (assuming Prettier has normalized root indentation).

As a result, indentation/newlines grow infinitely on each format run.

@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-bug Category - Bug labels Jan 14, 2026
Copy link
Member Author

leaysgur commented Jan 14, 2026


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.

@leaysgur leaysgur changed the title fix(oxfmt): Do not wrap with indent if format_embedded fails fix(oxfmt): Do not wrap with block_indent() if format_embedded fails Jan 14, 2026
@leaysgur leaysgur requested a review from Dunqing January 14, 2026 01:24
@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Jan 14, 2026
Copy link
Member

Dunqing commented Jan 14, 2026

Merge activity

…ils (#17975)

Fixes #17948 and may fix `next.js` repo diffs. => Confirmed all xxx-in-js diffs are resolved ✨

---

When Prettier fails to format embedded code (e.g., valid `css` tag but with invalid content), the previous implementation returned the original code as a successful result.

This caused issues because `block_indent` is always added (assuming Prettier has normalized root indentation).

As a result, indentation/newlines grow infinitely on each format run.
@graphite-app graphite-app bot force-pushed the 01-14-refactor_oxfmt_minimize_setblocking_true_workaround_scope branch from b3002a8 to 1c1da22 Compare January 14, 2026 05:10
@graphite-app graphite-app bot force-pushed the 01-14-fix_oxfmt_do_not_wrap_with_indent_if_format_embedded_fails branch from 0a0d37c to efacb13 Compare January 14, 2026 05:11
Base automatically changed from 01-14-refactor_oxfmt_minimize_setblocking_true_workaround_scope to main January 14, 2026 05:17
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 14, 2026
@graphite-app graphite-app bot merged commit efacb13 into main Jan 14, 2026
19 checks passed
@graphite-app graphite-app bot deleted the 01-14-fix_oxfmt_do_not_wrap_with_indent_if_format_embedded_fails branch January 14, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

formatter: Diff with Prettier on formatting embedded styled components strings

2 participants