Skip to content

Commit

Permalink
Merge pull request #596 from pouyayarandi/prevent-empty-swiftlint-res…
Browse files Browse the repository at this point in the history
…ponse-from-failure
  • Loading branch information
f-meloni committed Nov 6, 2023
2 parents a779c91 + 9d0b669 commit f76cd15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

## Master

- Prevent empty SwiftLint violation response from failure [@pouyayarandi][] - [#596](https://github.com/danger/swift/pull/596)

## 3.17.1

- Use http tap url on update homebrew script [@f-meloni][]
Expand Down
3 changes: 3 additions & 0 deletions Sources/Danger/Plugins/SwiftLint/SwiftLint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ extension SwiftLint {
}

private static func makeViolations(from response: String, failAction: (String) -> Void) -> [SwiftLintViolation] {
guard !response.isEmpty else {
return []
}
let decoder = JSONDecoder()
do {
let violations = try decoder.decode([SwiftLintViolation].self, from: Data(response.utf8))
Expand Down

0 comments on commit f76cd15

Please sign in to comment.