leoniralves / DangerSwiftPeriphery

Danger Swift plugin to run Periphery on CI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DangerSwiftPeriphery

Danger Swift plugin to run Periphery on CI.

Test MIT License

Features

This plugin will comment unreferenced code detected by periphery via Danger Swift.

Image

Usage

Preparation

Package.swift

let package = Package(
    // ...
    dependencies: [
        // Danger
        .package(name: "danger-swift", url: "https://github.com/danger/swift.git", from: "3.0.0"), // dev
        // Danger Plugins
        // Add the line below.
        .package(name: "DangerSwiftPeriphery", url: "https://github.com/taji-taji/DangerSwiftPeriphery.git", from: "1.0.0"), // dev
    ],
    targets: [
        // ...
        // Add DangerSwiftPeriphery to dependencies in DangerDependencies.
        .target(name: "DangerDependencies",
                dependencies: [
                    .product(name: "Danger", package: "danger-swift"),
                    "DangerSwiftPeriphery",
                ]),
        // ...
    ]
)

Dangerfile.swift

If you have a .periphery.yml file, simply include the following in Dangerfile.swift

import Danger
import DangerSwiftPeriphery

DangerPeriphery.scan()

Alternatively, periphery options can be passed as arguments.

import Danger
import DangerSwiftPeriphery

DangerPeriphery.scan(arguments: [
    "--workspace MaApp.xcworkspace",
    "--schemes MyApp",
    "--index-store-path /path/to/index/store",
    "--skip-build"
])

You may also specify the location of periphery binaries.

import DangerSwiftPeriphery

DangerPeriphery.scan(peripheryPath: "/path/to/periphery")

About

Danger Swift plugin to run Periphery on CI.

License:MIT License


Languages

Language:Swift 100.0%