fix(oxfmt): Canonicalize fixes for Windows#18575
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
There was a problem hiding this comment.
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.jsonorC:\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.
50179c3 to
5c1e01f
Compare
Merge activity
|
Fixes main CI failure on Windows.
5c1e01f to
736b706
Compare

Fixes main CI failure on Windows.