Skip to content

Update README based on errors found on working with Xcode 11.4.x+/Swift 5.2 and CI #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ You can use a "full SPM" solution to install both `danger-swift` and `DangerXCod
- Add to your `Package.swift`:

```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(
...
products: [
Expand All @@ -26,12 +31,14 @@ let package = Package(
],
dependencies: [
...
// Danger
.package(name: "danger-swift", url: "https://github.com/danger/swift.git", from: "3.0.0"), // dev
// Danger Plugins
.package(url: "https://github.com/f-meloni/danger-swift-xcodesummary", from: "0.1.0") // dev
.package(name: "DangerXCodeSummary", url: "https://github.com/f-meloni/danger-swift-xcodesummary", from: "1.2.1"), // dev
...
],
targets: [
.target(name: "DangerDependencies", dependencies: ["Danger", "DangerXCodeSummary"]), // dev
.target(name: "DangerDependencies", dependencies: ["danger-swift", "DangerXCodeSummary"]) // dev
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that could potentially remove some optimisations SPM would do here, given you only need the Danger library as dependency not the whole danger-swift, you don't need to build it all, then I would probably remove all the name: " change, at least for the danger-swift part.

...
]
)
Expand Down Expand Up @@ -65,7 +72,12 @@ DangerXCodeSummary can be used with SPM (this repo uses it on the Linux CI), but
To generate the report run:

```bash
swift test | XCPRETTY_JSON_FILE_OUTPUT=result.json xcpretty -f `xcpretty-json-formatter`
swift test 2>&1 | XCPRETTY_JSON_FILE_OUTPUT=xcpretty_xcode_summary.json xcpretty -f `xcpretty-json-formatter`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

2<&1

[...]

swift run danger-swift ci --fail-on-errors=true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct call should be

swift run danger-swift ci --failOnErrors

Also I'm not sure everyone wants that behaviour, it depends if you want or not your CI to continue after danger runs, Danger already updates the state of the PR, then it really depends on your workflow if it should or not fail the build

```

## Send report to Danger
Expand Down Expand Up @@ -104,4 +116,4 @@ let summary = XCodeSummary(json: JSONFile.jsonObject(fromString: warningsJSON),
return !file.contains("Sources/DangerXCodeSummary/")
})
summary.report()
```
```