Skip to content

Commit

Permalink
Print SwiftLint config path during error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed Apr 8, 2024
1 parent 5cde8be commit 065876e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ let package = Package(
)

func loadSwiftLintVersion() -> Version {
guard let yamlString = try? String(contentsOf: URL(fileURLWithPath: #file)
let swiftLintConfigURL = URL(fileURLWithPath: #file)
.deletingLastPathComponent()
.appendingPathComponent(".swiftlint.yml")) else {
fatalError("Failed to read YAML file.")
.appendingPathComponent(".swiftlint.yml")

guard let yamlString = try? String(contentsOf: swiftLintConfigURL) else {
fatalError("Failed to read SwiftLint config file at \(swiftLintConfigURL).")
}

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

0 comments on commit 065876e

Please sign in to comment.