forked from kinescope/ios-kinescope-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dangerfile.swift
26 lines (20 loc) · 1019 Bytes
/
Dangerfile.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import Danger
let danger = Danger()
if danger.github.pullRequest.title.starts(with: "[WIP]") {
danger.fail("WIP means work in progress. In other words author wants merge freeze ❄️")
}
var violations = [SwiftLintViolation]()
violations.append(contentsOf: SwiftLint.lint(.modifiedAndCreatedFiles(directory: "Sources"),
inline: false,
configFile: ".swiftlint.yml"))
violations.append(contentsOf: SwiftLint.lint(.modifiedAndCreatedFiles(directory: "Example"),
inline: false,
configFile: ".swiftlint.yml"))
switch violations.count {
case 0:
danger.message("Great! We didn't found any violations in your changes. Congratulations 🎉")
case 1..<20:
danger.warn("Oops! We have found some issues. It's better to fix them to keep code clean ")
default:
danger.fail("Omg. Your code smells bad. Please fix issues above")
}