Swiftpack.co - DomainGroupOSS/DomainDangerPlugin as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by DomainGroupOSS.
DomainGroupOSS/DomainDangerPlugin 0.3.0
One plugin to combine all the plugins across iOS repos
⭐️ 0
🕓 1 year ago
.package(url: "https://github.com/DomainGroupOSS/DomainDangerPlugin.git", from: "0.3.0")


Danger-Swift plugin to show the coverage of the modified/created files.


Getting Started

Install DangerSwiftCoverage

Swift Package Manager (More performant)

You can use a "full SPM" solution to install both danger-swift and DangerSwiftCoverage.

  • Add to your Package.swift:
let package = Package(
    products: [
        .library(name: "DangerDeps", type: .dynamic, targets: ["DangerDependencies"]), // dev
    dependencies: [
        // Danger Plugins
        .package(url: "https://github.com/DomainOSS/DomainDangerPlugin", from: "0.1.0") // dev
    targets: [
        .target(name: "DangerDependencies", dependencies: ["Danger", "DomainDangerPlugin"]), // dev
  • Add the correct import to your Dangerfile.swift:
import DomainDangerPlugin

  • Create a folder called DangerDependencies on Sources with an empty file inside like Fake.swift
  • To run Danger use swift run danger-swift command
  • (Recommended) If you are using SPM to distribute your framework, use Rocket, or similar to comment out all the dev depencencies from your Package.swift. This prevents the dev dependencies to be downloaded and compiled with your framework.


  • Add this to your Dangerfile.swift
import DangerSwiftCoverage // package: https://github.com/f-meloni/danger-swift-coverage

                            minimumCoverage: 50, 
                            excludedTargets: ["DangerSwiftCoverageTests.xctest"])
  • (Recommended) Cache the ~/.danger-swift folder

Gather Coverage

  • Enable "Gather the Coverage" on Xcode


or, on your CI, execute:

xcodebuild test -scheme DangerSwiftCoverage-Package -derivedDataPath Build/ -enableCodeCoverage YES

Custom XCResultBundle path

If you are using the -resultBundlePath parameter on xcodebuild you will need to use:

                            minimumCoverage: 50, 
                            excludedTargets: ["DangerSwiftCoverageTests.xctest"])

Swift Package Manager

From Swift 5.0 you can gather the coverage from SPM with the --enable-code-coverage=true flag For SPM coverage add to your Dangerfile:

Coverage.spmCoverage(minimumCoverage: 50)


This project is licensed under the terms of the MIT license. See the LICENSE file.


Stars: 0
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.


Release Notes

1 year ago

Rebuild danger

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics