Skip to content

Commit

Permalink
Add danger-swift plugin
Browse files Browse the repository at this point in the history
Add checking for SDK code syntaxis with swiftlint
  • Loading branch information
serhii-londar committed Dec 11, 2019
1 parent b468b20 commit 93cd102
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
12 changes: 12 additions & 0 deletions Dangerfile.swift
@@ -0,0 +1,12 @@
// Dangerfile.swift

import Foundation
import Danger

let danger = Danger()

if danger.git.createdFiles.count + danger.git.modifiedFiles.count - danger.git.deletedFiles.count > 10 {
warn("Big PR, try to keep changes smaller if you can")
}

SwiftLint.lint(directory: "CrowdinSDK/", configFile: "CrowdinSDK/Classes/.swiftlint.yml")
1 change: 1 addition & 0 deletions _dangerfile_imports.swift
@@ -0,0 +1 @@
import DangerSwiftLint // package: https://github.com/ashfurrow/DangerSwiftLint.git
18 changes: 14 additions & 4 deletions azure-pipelines.yml
Expand Up @@ -13,19 +13,29 @@ trigger:
- LICENSE

jobs:
- job: DangerSwiftLint
pool:
vmImage: 'macOS 10.14'
steps:
- bash: |
brew install swiftlint ; brew install danger/tap/danger-swift ; export DANGER_GITHUB_API_TOKEN='$(DANGER_GITHUB_API_TOKEN)' ; danger-swift ci
displayName: 'Danger SwiftLint'
- job: PodInstall
dependsOn: DangerSwiftLint
condition: succeeded()
pool:
vmImage: 'macOS 10.13'
vmImage: 'macOS 10.14'
steps:
- bash: |
cd Tests ; pod update Starscream; pod install
cd Tests ; pod update Starscream; pod update BaseAPI; pod install
displayName: 'Installing cocoapods'
- job: Build
dependsOn: PodInstall
condition: succeeded()
pool:
vmImage: 'macOS 10.13'
vmImage: 'macOS 10.14'
steps:
- task: Xcode@5
displayName: 'Build Xcode App'
Expand All @@ -42,7 +52,7 @@ jobs:
dependsOn: Build
condition: succeeded()
pool:
vmImage: 'macOS 10.13'
vmImage: 'macOS 10.14'
steps:
- task: Xcode@5
displayName: 'Running tests'
Expand Down

0 comments on commit 93cd102

Please sign in to comment.