Skip to content

fix(oxfmt): Use format_config for external_options override#18252

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-20-fix_oxfmt_use_format_config_for_external_options_override
Jan 19, 2026
Merged

fix(oxfmt): Use format_config for external_options override#18252
graphite-app[bot] merged 1 commit intomainfrom
01-20-fix_oxfmt_use_format_config_for_external_options_override

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Jan 19, 2026

Fixes #18246

Copilot AI review requested due to automatic review settings January 19, 2026 15:33
@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-bug Category - Bug labels Jan 19, 2026
Copy link
Member Author

leaysgur commented Jan 19, 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): Use format_config for external_options override fix(oxfmt): Use format_config for external_options override Jan 19, 2026
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 bug in the oxfmt configuration resolver where overrides weren't being applied correctly to options passed to external formatters (Prettier). The fix changes external_options to be constructed from format_config instead of raw_config, ensuring overrides are properly applied.

Changes:

  • Modified build_and_validate() to serialize format_config for external_options instead of cloning raw_config
  • Updated the slow path in resolve_options() with the same change for consistency
  • Added detailed comments explaining the trade-off: plugin-specific options are no longer preserved, but overrides now work correctly

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
apps/oxfmt/src/core/config.rs Changed external_options initialization from raw_config to serialized format_config in both fast and slow paths, with updated comments explaining the trade-off
apps/oxfmt/test/cli/oxfmtrc_overrides/snapshots/oxfmtrc_overrides.test.ts.snap Updated test snapshot showing the bug fix - Prettier options override test now passes (exit code 0 instead of 1)

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

@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Jan 19, 2026
Copy link
Member Author

leaysgur commented Jan 19, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the 01-20-fix_oxfmt_use_format_config_for_external_options_override branch from d673577 to 864b4ab Compare January 19, 2026 15:42
@graphite-app graphite-app bot merged commit 864b4ab into main Jan 19, 2026
19 checks passed
@graphite-app graphite-app bot deleted the 01-20-fix_oxfmt_use_format_config_for_external_options_override branch January 19, 2026 15:48
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 19, 2026
overlookmotel added a commit that referenced this pull request Jan 19, 2026
# Oxlint
### ⚡ Performance

- 1a247f1 linter/no-redeclare: Avoid repeated PHF hashmap lookups
(#18248) (overlookmotel)

### 📚 Documentation

- 8a294d5 oxfmt, oxlint: Update logo (#18242) (Dunqing)
# Oxfmt
### 🐛 Bug Fixes

- 864b4ab oxfmt: Use `format_config` for `external_options` override
(#18252) (leaysgur)
- 90ce4b7 oxfmt: Restore `customGroups` handling lost (#18243)
(leaysgur)

### 📚 Documentation

- 8a294d5 oxfmt, oxlint: Update logo (#18242) (Dunqing)

Co-authored-by: overlookmotel <557937+overlookmotel@users.noreply.github.com>
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: overrides not working

2 participants