Skip to content

refactor(oxfmt): Make support.rs simple#17109

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-19-refactor_oxfmt_prepare_for_oxfmt-toml_support
Dec 19, 2025
Merged

refactor(oxfmt): Make support.rs simple#17109
graphite-app[bot] merged 1 commit intomainfrom
12-19-refactor_oxfmt_prepare_for_oxfmt-toml_support

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Dec 19, 2025

Also prepare for toml support.

Copilot AI review requested due to automatic review settings December 19, 2025 04:58
@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Dec 19, 2025
Copy link
Member Author

leaysgur commented Dec 19, 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.

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 refactors the file format detection logic in oxfmt to prepare for future oxfmt-toml support. The refactoring improves code organization by separating the parser name resolution logic and making the file type detection flow clearer.

  • Extracts parser name logic from get_external_format_source into a new get_external_parser_name function that returns just the parser name string
  • Adds a new can_format_without_external() method to check if a file can be formatted without external dependencies
  • Reorganizes the file detection flow in TryFrom<PathBuf> to be more explicit and sequential

Reviewed changes

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

File Description
apps/oxfmt/src/core/support.rs Refactors file format detection by extracting parser name resolution into a separate function, adds can_format_without_external() method, and reorganizes the detection flow in TryFrom<PathBuf>
apps/oxfmt/src/cli/walk.rs Updates tier comments to reflect future TOML support and uses the new can_format_without_external() method instead of direct pattern matching

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

@leaysgur leaysgur force-pushed the 12-19-refactor_oxfmt_prepare_for_oxfmt-toml_support branch 2 times, most recently from 59447a2 to c845bab Compare December 19, 2025 05:04
@leaysgur leaysgur changed the title refactor(oxfmt): Prepare for oxfmt-toml support refactor(oxfmt): Make support.rs simple Dec 19, 2025
@leaysgur leaysgur force-pushed the 12-19-refactor_oxfmt_prepare_for_oxfmt-toml_support branch from c845bab to 83e8dd6 Compare December 19, 2025 05:06
@leaysgur leaysgur requested a review from Dunqing December 19, 2025 05:35
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Dec 19, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 19, 2025

Merge activity

Also prepare for `toml` support.
@graphite-app graphite-app bot force-pushed the 12-19-refactor_oxfmt_prepare_for_oxfmt-toml_support branch from 83e8dd6 to 750d4b3 Compare December 19, 2025 13:43
@graphite-app graphite-app bot merged commit 750d4b3 into main Dec 19, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 12-19-refactor_oxfmt_prepare_for_oxfmt-toml_support branch December 19, 2025 13:49
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 19, 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-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants