You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varurl=URL(fileURLWithPath:"/whatever/test.swift")print("'\(url.path)'")// prints '/whatever/test.swift'
url.deleteLastPathComponent()print("'\(url.path)'")// prints '/whatever'
url.deleteLastPathComponent()print("'\(url.path)'")// prints ''
url =URL(fileURLWithPath:"/test.swift")print("'\(url.path)'")// prints '/test.swift'
url.deleteLastPathComponent()print("'\(url.path)'")// prints '/'
Where it prints '' at the end of the first section, I think it should print /.
This is in a Swift 6.0 Linux docker image.
The text was updated successfully, but these errors were encountered:
ahoppen
added a commit
to ahoppen/swift-format
that referenced
this issue
Oct 11, 2024
Due to swiftlang/swift-foundation#980, the we may end up with a `path == ""` instead of `/`.
We didn’t catch this in the test because we only end up with an empty path when searching for a `.swift-format` file from a `.swift-file` that was not at the root of a directory.
Due to swiftlang/swift-foundation#980, the we may end up with a `path == ""` instead of `/`.
We didn’t catch this in the test because we only end up with an empty path when searching for a `.swift-format` file from a `.swift-file` that was not at the root of a directory.
Where it prints
''
at the end of the first section, I think it should print/
.This is in a Swift 6.0 Linux docker image.
The text was updated successfully, but these errors were encountered: