Skip to content

Commit

Permalink
Add Dangerfile (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
KS1019 authored Jun 19, 2022
1 parent 7d0722a commit b7b4af7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dangerfile.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// swiftlint:disable line_length
import Danger

let danger = Danger()
let allSourceFiles = danger.git.modifiedFiles + danger.git.createdFiles

if allSourceFiles.first(where: { $0.fileType == .swift }) != nil {
// Only modified and created files are linted.
// See https://github.com/danger/swift/blob/d951a755f7e9335321160272698a2ede9dc572a3/Sources/Danger/Plugins/SwiftLint/SwiftLint.swift#L91
let violation = SwiftLint.lint()
if violation.isEmpty {
message("No violation found!!!")
}
}

0 comments on commit b7b4af7

Please sign in to comment.