Skip to content

Commit f76cd15

Browse files
authored
Merge pull request #596 from pouyayarandi/prevent-empty-swiftlint-response-from-failure
2 parents a779c91 + 9d0b669 commit f76cd15

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
## Master
1515

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

1820
- Use http tap url on update homebrew script [@f-meloni][]

Sources/Danger/Plugins/SwiftLint/SwiftLint.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ extension SwiftLint {
307307
}
308308

309309
private static func makeViolations(from response: String, failAction: (String) -> Void) -> [SwiftLintViolation] {
310+
guard !response.isEmpty else {
311+
return []
312+
}
310313
let decoder = JSONDecoder()
311314
do {
312315
let violations = try decoder.decode([SwiftLintViolation].self, from: Data(response.utf8))

0 commit comments

Comments
 (0)