-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileIterator
returns broken URLs when the working directory is /
#862
Comments
Synced to Apple’s issue tracker as rdar://138492445 |
I've got a simple fix for this, just trying to find a way to add test coverage for it. As it stands this particular code path wasn't covered to begin with and it would be nice to do it now. I also don't know what I should do about Windows support... |
macshome
added a commit
to macshome/swift-format
that referenced
this issue
Oct 25, 2024
Added an additional check that tests to see if the working directory is root. swiftlang#862
This was referenced Oct 25, 2024
ahoppen
pushed a commit
to ahoppen/swift-format
that referenced
this issue
Dec 4, 2024
Added an additional check that tests to see if the working directory is root. swiftlang#862
ahoppen
pushed a commit
to macshome/swift-format
that referenced
this issue
Dec 5, 2024
Added an additional check that tests to see if the working directory is root. swiftlang#862
ahoppen
pushed a commit
to macshome/swift-format
that referenced
this issue
Dec 5, 2024
Added an additional check that tests to see if the working directory is root. swiftlang#862
ahoppen
pushed a commit
to macshome/swift-format
that referenced
this issue
Dec 5, 2024
Added an additional check that tests to see if the working directory is root. swiftlang#862
ahoppen
pushed a commit
to macshome/swift-format
that referenced
this issue
Dec 5, 2024
Added an additional check that tests to see if the working directory is root. swiftlang#862
Resolved by #865 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When you use the
-r
option andworkingDirectory.path
is"/"
,String(path.dropFirst(workingDirectory.path.count + 1))
will remove the first character of the file path, soFileIterator
returns broken URLs and swift-format can't read any file.swift-format/Sources/SwiftFormat/Utilities/FileIterator.swift
Line 149 in 3ca1a18
How to reproduce the issue
For instance, on wasm32-unknown-wasi,
URL(fileURLWithPath: ".")
will be/
, so this is the problem.And also, the issue can be reproducible on normal platforms like this:
My environment:
The text was updated successfully, but these errors were encountered: