Skip to content

Commit

Permalink
Swiftlint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
f-meloni committed Jan 25, 2019
1 parent 08e2d10 commit fd6679e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/RunnerLib/SPMDanger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ public struct SPMDanger {
public init?(packagePath: String = "Package.swift") {
let packageContent = (try? String(contentsOfFile: packagePath)) ?? ""

let regex = try? NSRegularExpression(pattern: "\\.library\\(name:[\\ ]?\"(\(SPMDanger.dangerDepsPrefix)[A-Za-z]*)", options: .allowCommentsAndWhitespace)
let firstMatch = regex?.firstMatch(in: packageContent, options: .withTransparentBounds, range: NSRange(location: 0, length: packageContent.count))
let regex = try? NSRegularExpression(pattern: "\\.library\\(name:[\\ ]?\"(\(SPMDanger.dangerDepsPrefix)[A-Za-z]*)",
options: .allowCommentsAndWhitespace)
let firstMatch = regex?.firstMatch(in: packageContent,
options: .withTransparentBounds,
range: NSRange(location: 0, length: packageContent.count))

if let depsLibNameRange = firstMatch?.range(at: 1),
let range = Range(depsLibNameRange, in: packageContent) {
Expand Down

0 comments on commit fd6679e

Please sign in to comment.