Skip to content

fix(oxfmt): Canonicalize fixes for Windows#18575

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-26-fix_oxfmt_canonicalize_fixes_for_windows
Jan 26, 2026
Merged

fix(oxfmt): Canonicalize fixes for Windows#18575
graphite-app[bot] merged 1 commit intomainfrom
01-26-fix_oxfmt_canonicalize_fixes_for_windows

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Jan 26, 2026

Fixes main CI failure on Windows.

Copilot AI review requested due to automatic review settings January 26, 2026 09:58
@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter labels Jan 26, 2026
Copy link
Member Author


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 path canonicalization issues on Windows by replacing fs::canonicalize() with a logical path component resolution approach. The main motivation is to avoid \\?\ prefixed paths that fs::canonicalize() produces on Windows, which cause problems with gitignore pattern matching.

Changes:

  • Replaced filesystem-based canonicalization with logical path component resolution
  • Updated function to resolve . and .. components without filesystem access
  • Enhanced documentation to explain differences from fs::canonicalize()
Comments suppressed due to low confidence (1)

apps/oxfmt/src/core/utils.rs:76

  • Absolute paths are returned without normalizing . and .. components. While rare in practice, an absolute path could contain these components (e.g., /home/user/../foo.json or C:\Users\Public\..\foo.json). For consistency with the documented behavior of "resolving . and .. components logically", consider applying the normalization logic to absolute paths as well, or updating the documentation to clarify that absolute paths are not normalized.
    if path.is_absolute() {
        return path.to_path_buf();
    }

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

@leaysgur leaysgur force-pushed the 01-26-fix_oxfmt_canonicalize_fixes_for_windows branch 3 times, most recently from 50179c3 to 5c1e01f Compare January 26, 2026 10:20
@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Jan 26, 2026
Copy link
Member Author

leaysgur commented Jan 26, 2026

Merge activity

Fixes main CI failure on Windows.
@graphite-app graphite-app bot force-pushed the 01-26-fix_oxfmt_canonicalize_fixes_for_windows branch from 5c1e01f to 736b706 Compare January 26, 2026 10:27
@graphite-app graphite-app bot merged commit 736b706 into main Jan 26, 2026
19 checks passed
@graphite-app graphite-app bot deleted the 01-26-fix_oxfmt_canonicalize_fixes_for_windows branch January 26, 2026 10:33
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 26, 2026
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.

1 participant

Comments