Danger Swift plugin to run Periphery on CI.
This plugin will comment unreferenced code detected by periphery via Danger Swift.
- Install Periphery on the machine you want to run Danger Swift on beforehand.
- Danger Swift Setup.
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",
]),
// ...
]
)
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")