Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Danger-Swift 導入のススメ / Path to import Danger-Swift

Danger-Swift 導入のススメ / Path to import Danger-Swift

Elvis Shi

July 22, 2020
Tweet

More Decks by Elvis Shi

Other Decks in Programming

Transcript

  1. } var employedBy = "YUMEMI Inc." var job = "iOS

    Tech Lead" var favoriteLanguage = "Swift" var twitter = "@lovee" var qiita = "lovee" var github = "el-hoshino" var additionalInfo = """ Nintendo Switch ͕ͳ͔ͳ͔౰ͨΒͳ͍! """ final class Me: Developable, Talkable {
  2. %BOHFSpMFTXJGUαϯϓϧ let danger = Danger() // ςετΧόϨοδΛ֬ೝ import DangerSwiftCoverage //

    package: https://github.com/f-meloni/danger-swift-coverage.git Coverage.xcodeBuildCoverage(.xcresultBundle("Test.xcresult"), minimumCoverage: 60) // Changelog ฤूঢ়گ֬ೝ if !danger.git.modifiedFiles.contains(where: { $0 == "CHANGELOG.md" }) { danger.warn("CHANGELOG Λฤू͍ͯͩ͘͠͞ɻ") } // SwiftLint ϫʔχϯάΛ֬ೝ SwiftLint.lint() // मਖ਼ྔΛ֬ೝ let additions = danger.github.pullRequest.additions ?? 0 let deletions = danger.github.pullRequest.deletions ?? 0 if additions + deletions > 1_000 { danger.warn("मਖ਼ྔ͕ଟ͗͢Ͱ͢ɻPR Λখ͘͞෼ׂ͍ͯͩ͘͠͞ɻ") } // ϦϦʔεલͷόʔδϣϯ൪߸มߋ֬ೝ import DangerSwiftHammer // package: https://github.com/el-hoshino/DangerSwiftHammer.git if danger.github.pullRequest.head.ref == "master" { let xcodeprojFileDiff = danger.hammer.diffLines(in: "Project.xcodeproj/project.pbxproj") if !xcodeprojFileDiff.additions.contains(where: { $0.contains("MARKETING_VERSION = ") }) { danger.warn("ϦϦʔεલʹόʔδϣϯ൪߸Λมߋ͍ͯͩ͘͠͞") } }