Skip to content

A danger-swift plug-in to check if the PR matches a specific workflow (e.g. Git-Flow)

License

Notifications You must be signed in to change notification settings

yumemi-inc/danger-swift-eda

Repository files navigation

Build

danger-swift-eda

A danger-swift plug-in to check if the PR matches a specific workflow (e.g. Git-Flow)

Install DangerSwiftEda

SwiftPM (Recommended)

  • Add dependency package to your Package.swift file which you import danger-swift

    // swift-tools-version:5.5
    ...
    let package = Package(
        ...
        dependencies: [
            ...
            // Danger Plugins
            .package(name: "DangerSwiftEda", url: "https://www.github.com/yumemi-inc/danger-swift-eda.git", from: "0.1.0"),
            ...
        ],
        ...
    )
  • Add the correct import to your Dangerfile.swift file

    import DangerSwiftEda

Marathon (Tool Deprecated)

  • Just add the dependency import to your Dangerfile.swift file like this:

    import DangerSwiftEda // package: https://github.com/yumemi-inc/danger-swift-eda.git

Usage

  • Setup a configuration based on the workflow you'd like to perform (currently only Git-Flow supported)

    let configuration = GitFlowCheckConfiguration(
        // ...
    )

    TIPS: We also have GitFlowCheckConfiguration.default if you just want to use default configuration.

  • Perform the workflow check with eda.checkPR method which is available for DangerDSL instances

    danger.eda.checkPR(workflow: .gitFlow(configuration)) // Assume you have initialized `danger` by code like `let danger = Danger()`

Preview

Code above will make danger producing markdown messages like below

Feature PR Check

Checking Item Result
Base Branch Check 🎉
Merge Commit Non-Existence Check 🎉
Diff Volume Check 🤔
ChangeLog Modification Check 🤔
Warnings
⚠️ This PR doesn't contain any modifications in CHANGELOG.md. Please consider to update the ChangeLog.
⚠️ There's too much diff. Please make PRs smaller.

About

A danger-swift plug-in to check if the PR matches a specific workflow (e.g. Git-Flow)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages