Skip to content
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

Initial support to swift 5.0 #210

Merged
merged 5 commits into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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
34 changes: 28 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@ matrix:
- make install
script:
- swift test
# - DEBUG="*" danger process .build/x86_64-apple-macosx10.10/debug/danger-swift
# - DEBUG="*" danger ci --process .build/x86_64-apple-macosx10.10/debug/danger-swift
# - sudo chmod -R a+rwx /usr/local/Cellar/
# - DEBUG="*" danger-swift ci
# - DEBUG="*" .build/x86_64-apple-macosx10.10/debug/danger-swift ci
- .build/x86_64-apple-macosx10.10/debug/danger-swift ci
- danger-swift ci

- os: osx
name: Swift 5.0
osx_image: xcode10.2
install:
- node -v
- npm install -g danger
- make install
script:
- swift test
- danger-swift ci

- os: osx
osx_image: xcode10
Expand All @@ -48,6 +54,22 @@ matrix:
- make install
- DEBUG="*" danger-swift ci

- os: linux
language: generic
sudo: required
dist: trusty
name: Swift 5.0
install:
- node -v
- npm install -g danger
- echo '5.0-DEVELOPMENT-SNAPSHOT-2019-03-06-a' > .swift-version
- eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
script:
- swift test
- sudo chmod -R a+rwx /usr/local/
- make install
- DEBUG="*" danger-swift ci

- os: osx
name: Danger with SPM
osx_image: xcode10
Expand Down
16 changes: 8 additions & 8 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/thoughtbot/Curry.git",
"state": {
"branch": null,
"revision": "b6bf27ec9d711f607a8c7da9ca69ee9eaa201a22",
"version": "4.0.1"
"revision": "4331dd50bc1db007db664a23f32e6f3df93d4e1a",
"version": "4.0.2"
}
},
{
Expand Down Expand Up @@ -195,17 +195,17 @@
"repositoryURL": "https://github.com/nicklockwood/SwiftFormat",
"state": {
"branch": null,
"revision": "8e0f9569415605082d0b6306f0b3dbde4facb74d",
"version": "0.39.3"
"revision": "543df82383ebfae4696c70809ae36ff3df63e9c6",
"version": "0.39.5"
}
},
{
"package": "SwiftLint",
"repositoryURL": "https://github.com/Realm/SwiftLint",
"state": {
"branch": null,
"revision": "b2d428a4e24abd4f7cfeb0cd610b1656fb48c4a9",
"version": "0.30.1"
"revision": "26c0048cf4567f0e96f97e2c567ce1c05209e476",
"version": "0.31.0"
}
},
{
Expand All @@ -231,8 +231,8 @@
"repositoryURL": "https://github.com/drmohundro/SWXMLHash.git",
"state": {
"branch": null,
"revision": "9ba116841126f6c63435beef21a4cd247c32d2e7",
"version": "4.7.6"
"revision": "0d6bb315528888edde0dafe93564f074669c44e9",
"version": "4.8.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/RunnerLib/Files Import/DangerFileGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public final class DangerFileGenerator {
importsRegex.enumerateMatches(in: content, options: [], range: NSRange(location: 0, length: content.count), using: { result, _, _ in

Choose a reason for hiding this comment

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

  • ⚠️ Line should be 120 characters or less: currently 140 characters (line_length)

// Adjust the result to have the correct range also after dangerContent is modified
guard let result = result?.adjustingRanges(offset:
dangerContent.endIndex.encodedOffset - content.endIndex.encodedOffset) else { return }
dangerContent.utf16.count - content.utf16.count) else { return }
let url = importsRegex.replacementString(for: result, in: dangerContent, offset: 0, template: "$1")

guard let fileContent = try? String(contentsOfFile: url),
Expand Down
Loading