Skip to content

Commit b7b4af7

Browse files
authored
Add Dangerfile (#4)
1 parent 7d0722a commit b7b4af7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Dangerfile.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// swiftlint:disable line_length
2+
import Danger
3+
4+
let danger = Danger()
5+
let allSourceFiles = danger.git.modifiedFiles + danger.git.createdFiles
6+
7+
if allSourceFiles.first(where: { $0.fileType == .swift }) != nil {
8+
// Only modified and created files are linted.
9+
// See https://github.com/danger/swift/blob/d951a755f7e9335321160272698a2ede9dc572a3/Sources/Danger/Plugins/SwiftLint/SwiftLint.swift#L91
10+
let violation = SwiftLint.lint()
11+
if violation.isEmpty {
12+
message("No violation found!!!")
13+
}
14+
}

0 commit comments

Comments
 (0)