Skip to content

Commit e451937

Browse files
Wei SunWei Sun
authored andcommitted
[Danger] Update Dangerfile
- move commit lint ahead of github checks, because gihub checks gets cancelled when running `danger-swift local`
1 parent dff328a commit e451937

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Dangerfile.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ let filesToLint = (danger.git.modifiedFiles + danger.git.createdFiles)
2222

2323
SwiftLint.lint(.files(filesToLint), inline: true)
2424

25+
let configuration = DangerSwiftCommitLint.Configuration(warn: .all)
26+
let commitLint = DangerSwiftCommitLint(danger: danger, configuration: configuration)
27+
commitLint.check()
28+
2529
// Only run GitHub related checks when GitHub dsl is available. This allows `danger-swift local` to work.
2630
guard let github = danger.github else {
2731
warn("Unable to parse GitHub DSL response, the GitHub related checks will be skipped. (i.e. running `danger-swift local`).")
@@ -38,7 +42,3 @@ let foundWIPLabel = github.issue.labels.contains {
3842
if foundWIPMessageInTitle || foundWIPLabel {
3943
warn("PR is classed as Work in Progress")
4044
}
41-
42-
let configuration = DangerSwiftCommitLint.Configuration(warn: .all)
43-
let commitLint = DangerSwiftCommitLint(danger: danger, configuration: configuration)
44-
commitLint.check()

0 commit comments

Comments
 (0)