Skip to content

Commit

Permalink
Fix Package.swift spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
iangmaia committed Feb 23, 2024
1 parent d038224 commit 9d06f66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ func loadSwiftLintVersion() -> Version {
.appendingPathComponent(".swiftlint.yml")) else {
fatalError("Failed to read YAML file.")
}

guard let versionLine = yamlString.components(separatedBy: .newlines)
.first(where: { $0.contains("swiftlint_version") }) else {
fatalError("SwiftLint version not found in YAML file.")
}

// assumes the format `swiftlint_version: <version>`
guard let version = Version(versionLine.components(separatedBy: ":")
.last?
.trimmingCharacters(in: .whitespaces) ?? "") else {
fatalError("Failed to extract SwiftLint version.")
}

return version
}

0 comments on commit 9d06f66

Please sign in to comment.