Skip to content

fix(oxfmt): Resolve .editorconfig root dir from cwd#17093

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-19-fix_oxfmt_resolve_.editorconfig_root_dir_from_cwd
Dec 19, 2025
Merged

fix(oxfmt): Resolve .editorconfig root dir from cwd#17093
graphite-app[bot] merged 1 commit intomainfrom
12-19-fix_oxfmt_resolve_.editorconfig_root_dir_from_cwd

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Dec 19, 2025

Follow up #17044

  • Set cwd to EditorConfig to handle absolute path
  • Restore skipped tests

Copilot AI review requested due to automatic review settings December 19, 2025 01:08
@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-bug Category - Bug 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 fixes the editorconfig resolution to properly resolve the root directory from the current working directory (cwd). Previously, the editorconfig parser did not receive the cwd context, which prevented per-file overrides from working correctly.

  • Adds cwd parameter to ConfigResolver::from_config_paths() method
  • Passes cwd to EditorConfig::parse().with_cwd() for proper path resolution
  • Enables previously skipped test for per-file editorconfig overrides

Reviewed changes

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

Show a summary per file
File Description
apps/oxfmt/src/core/config.rs Adds cwd parameter to from_config_paths() and passes it to EditorConfig::parse().with_cwd()
apps/oxfmt/src/cli/format.rs Updates call site to pass &cwd parameter
apps/oxfmt/src/stdin/mod.rs Updates call site to pass &cwd parameter
apps/oxfmt/test/editorconfig.test.ts Enables previously skipped test and updates expected behavior comments
apps/oxfmt/test/fixtures/editorconfig/per_file_override/.editorconfig Updates fixture to use indent_style = tab for better demonstration of per-file overrides
apps/oxfmt/test/__snapshots__/editorconfig.test.ts.snap Adds snapshot for the now-enabled per-file override test case

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

@leaysgur leaysgur requested a review from Dunqing December 19, 2025 01:18
@leaysgur leaysgur changed the title fix(oxfmt): Resolve .editorconfig root dir from cwd fix(oxfmt): Resolve .editorconfig root dir from cwd Dec 19, 2025
@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

graphite-app bot pushed a commit that referenced this pull request Dec 19, 2025
Follow up #17044

- Set `cwd` to `EditorConfig` to handle absolute path
- Restore skipped tests
@graphite-app graphite-app bot force-pushed the 12-19-fix_oxfmt_resolve_.editorconfig_root_dir_from_cwd branch from e184ad6 to f045903 Compare December 19, 2025 04:27
Follow up #17044

- Set `cwd` to `EditorConfig` to handle absolute path
- Restore skipped tests
@graphite-app graphite-app bot force-pushed the 12-19-fix_oxfmt_resolve_.editorconfig_root_dir_from_cwd branch from f045903 to cdb80d4 Compare December 19, 2025 04:32
@graphite-app graphite-app bot merged commit cdb80d4 into main Dec 19, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 12-19-fix_oxfmt_resolve_.editorconfig_root_dir_from_cwd branch December 19, 2025 04:39
@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-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants