File tree Expand file tree Collapse file tree 2 files changed +27
-14
lines changed
Sources/SwiftFormat/Utilities Expand file tree Collapse file tree 2 files changed +27
-14
lines changed Original file line number Diff line number Diff line change @@ -209,17 +209,3 @@ private func inputShouldBeProcessed(at url: URL) -> Bool {
209
209
} while !containingDirectory. isRoot
210
210
return true
211
211
}
212
-
213
- fileprivate extension URL {
214
- var isRoot : Bool {
215
- #if os(Windows)
216
- // FIXME: We should call into Windows' native check to check if this path is a root once https://github.com/swiftlang/swift-foundation/issues/976 is fixed.
217
- // https://github.com/swiftlang/swift-format/issues/844
218
- return self . pathComponents. count <= 1
219
- #else
220
- // On Linux, we may end up with an string for the path due to https://github.com/swiftlang/swift-foundation/issues/980
221
- // TODO: Remove the check for "" once https://github.com/swiftlang/swift-foundation/issues/980 is fixed.
222
- return self . path == " / " || self . path == " "
223
- #endif
224
- }
225
- }
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ //===----------------------------------------------------------------------===//
12
+
13
+ import Foundation
14
+
15
+ extension URL {
16
+ var isRoot : Bool {
17
+ #if os(Windows)
18
+ // FIXME: We should call into Windows' native check to check if this path is a root once https://github.com/swiftlang/swift-foundation/issues/976 is fixed.
19
+ // https://github.com/swiftlang/swift-format/issues/844
20
+ return self . pathComponents. count <= 1
21
+ #else
22
+ // On Linux, we may end up with an string for the path due to https://github.com/swiftlang/swift-foundation/issues/980
23
+ // TODO: Remove the check for "" once https://github.com/swiftlang/swift-foundation/issues/980 is fixed.
24
+ return self . path == " / " || self . path == " "
25
+ #endif
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments