Skip to content

Commit add49e7

Browse files
committed
Go with standardization only
1 parent 04c128c commit add49e7

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

Source/SwiftLintCore/Extensions/URL+SwiftLint.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public extension URL {
3434
/// > Warning: Use this representation only for displaying file paths to users. It is not
3535
/// suitable for file operations.
3636
var relativeDisplayPath: String {
37-
let path = path.replacing(URL.cwd.path, with: "")
37+
let path = path.replacing(Self.cwd.path, with: "")
3838
if path.starts(with: "/") {
3939
return String(path.dropFirst())
4040
}

Source/SwiftLintFramework/Extensions/FileManager+SwiftLint.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ extension FileManager: LintableFileManager {
5555
.isSymbolicLinkKey,
5656
]
5757
private static let enumeratorOptions: DirectoryEnumerationOptions = [
58-
.producesRelativePathURLs,
5958
.skipsPackageDescendants,
6059
.skipsSubdirectoryDescendants,
6160
]
@@ -93,14 +92,11 @@ extension FileManager: LintableFileManager {
9392
for case var element as URL in enumerator {
9493
var resourceValues = try? element.resourceValues(forKeys: Self.enumeratorProperties)
9594
if resourceValues?.isSymbolicLink == true {
95+
element = element.standardizedFileURL
9696
if excluder.excludes(path: element) {
9797
continue
9898
}
9999
element.resolveSymlinksInPath()
100-
element = URL(
101-
fileURLWithPath: element.lastPathComponent,
102-
relativeTo: element.deletingLastPathComponent()
103-
)
104100
resourceValues = try? element.resourceValues(forKeys: Self.enumeratorProperties)
105101
}
106102
if resourceValues?.isRegularFile == true {

0 commit comments

Comments
 (0)