danger / danger/swift

[Question] Do we need to install the danger-swift when using SPM?

Open
#336 5 comments 3 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
1.1k
Forks
152
Avg merge
9h 54m
Merged PRs (30d)
2

Description

I have set up the swift package manager file

```swift
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "DangerTarget",
products: [
.library(name: "DangerDepsPipefy", type: .dynamic, targets: ["DangerTarget"])
],
dependencies: [
.package(name: "danger-swift", url: "https://github.com/danger/swift.git", from: "3.3.0")
],
targets: [
.target(
name: "DangerTarget",
dependencies: [.product(name: "danger-swift", package: "danger-swift")],
path: ".",
sources: ["dummy.swift"]
),
]
)

```

When I try to run the `swift run danger-swift command`

```
👉 swift run danger-swift local
ERROR: Danger JS was not found on the system
Please install it with npm or brew
```

I'm getting an error, which is not clear in the setup whether I have to install the dependencies with homebrew or not.

From docs:

> We recommend you install Danger via Swift Package Manager. Though you can use homebrew also. Using Swift PM means you safely lock your versions, making your tooling more reliable.

It appears to me that with swift package manager I would be able to run the danger without having to install via homebrew. Did I get it wrong?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.