Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/yumemi-inc/danger-swift-eda

A danger-swift plug-in to check if the PR matches a specific workflow (e.g. Git-Flow)
https://github.com/yumemi-inc/danger-swift-eda

Last synced: 4 months ago
JSON representation

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

Lists

README

        

[![Build](https://github.com/yumemi-inc/danger-swift-eda/actions/workflows/test.yml/badge.svg)](https://github.com/yumemi-inc/danger-swift-eda/actions/workflows/test.yml)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fyumemi-inc%2Fdanger-swift-eda%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/yumemi-inc/danger-swift-eda)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fyumemi-inc%2Fdanger-swift-eda%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/yumemi-inc/danger-swift-eda)

# danger-swift-eda

A [danger-swift](https://github.com/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
// 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

```swift
import DangerSwiftEda
```

### Marathon ([Tool Deprecated](https://github.com/JohnSundell/Marathon))

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

```swift
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**)

```swift
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

```swift
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 | :tada:
> Merge Commit Non-Existence Check | :tada:
> Diff Volume Check | :thinking:
> ChangeLog Modification Check | :thinking:
>
>
>
>
>
> Warnings
>
>
>
> :warning:
> This PR doesn't contain any modifications in CHANGELOG.md. Please consider to update the ChangeLog.
>
>
>
> :warning:
> There's too much diff. Please make PRs smaller.
>
>
>