Skip to content

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Oct 21, 2025

Fixes #14575

Copilot AI review requested due to automatic review settings October 21, 2025 05:24
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 adds support for .oxfmtrc.jsonc configuration files in oxfmt, with .json files taking priority when both formats exist in the same directory. The configuration file discovery logic now searches for both file types during upward directory traversal.

Key Changes:

  • Extended config file search to support both .json and .jsonc extensions
  • Established priority where .json takes precedence over .jsonc
  • Added test fixture to verify the priority behavior

Reviewed Changes

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

File Description
apps/oxfmt/src/format.rs Modified config discovery to iterate through both .json and .jsonc filenames with priority ordering
apps/oxfmt/tests/mod.rs Added documentation explaining the test validates .json priority over .jsonc
apps/oxfmt/tests/fixtures/config_file/.oxfmtrc.jsonc Added test fixture with semi: false to contrast with existing .json file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member Author

leaysgur commented Oct 21, 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.

@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-enhancement Category - New feature or request labels Oct 21, 2025
@leaysgur leaysgur requested a review from Dunqing October 21, 2025 05:45
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Oct 21, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 21, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 10-21-feat_oxfmt_search_both_.json_and_.jsonc_config_file branch from 5e9bee9 to 6dfcd80 Compare October 21, 2025 09:32
@graphite-app graphite-app bot merged commit 6dfcd80 into main Oct 21, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 10-21-feat_oxfmt_search_both_.json_and_.jsonc_config_file branch October 21, 2025 09:40
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 21, 2025
@Boshen Boshen mentioned this pull request Oct 21, 2025
graphite-app bot pushed a commit that referenced this pull request Oct 21, 2025
## [0.7.0] - 2025-10-21

### 🚀 Features

- 6dfcd80 oxfmt: Search both .json and .jsonc config file (#14848) (leaysgur)
- aa024d9 formatter: Wrap parenthesis for `AssignmentExpression` that are inside `ComputedMemberExpression` (#14834) (Dunqing)

### 🐛 Bug Fixes

- 88fb768 formatter: Correct handling of ignore comment for `TSUnionType` and `TSMappedType` (#14824) (Dunqing)
- f7727c7 formatter: Ignore comment doesn't work for the expression statement (#14817) (Dunqing)
- 7a420a1 oxfmt: Handle `.d.ts` file correctly (#14835) (leaysgur)

### 🚜 Refactor

- 6fa7420 oxfmt: Use custom ignore builder (#14850) (leaysgur)
- 9d914a3 formatter: Improve comments handling (#14816) (Dunqing)
- f52863d formatter: Improve handling of type cast node (#14815) (Dunqing)
graphite-app bot pushed a commit that referenced this pull request Oct 22, 2025
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-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oxfmt: Make .oxfmtrc.jsonc the default instead of .json?

3 participants