Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit 065876e

Browse files
committed
Print SwiftLint config path during error handling
1 parent 5cde8be commit 065876e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Package.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ let package = Package(
6363
)
6464

6565
func loadSwiftLintVersion() -> Version {
66-
guard let yamlString = try? String(contentsOf: URL(fileURLWithPath: #file)
66+
let swiftLintConfigURL = URL(fileURLWithPath: #file)
6767
.deletingLastPathComponent()
68-
.appendingPathComponent(".swiftlint.yml")) else {
69-
fatalError("Failed to read YAML file.")
68+
.appendingPathComponent(".swiftlint.yml")
69+
70+
guard let yamlString = try? String(contentsOf: swiftLintConfigURL) else {
71+
fatalError("Failed to read SwiftLint config file at \(swiftLintConfigURL).")
7072
}
7173

7274
guard let versionLine = yamlString.components(separatedBy: .newlines)

0 commit comments

Comments
 (0)