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

Gardening. #trivial #12

Merged
merged 4 commits into from
May 1, 2018
Merged
Show file tree
Hide file tree
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
36 changes: 36 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 2
jobs:
build:
working_directory: ~/ashfurrow/danger-swiftlint
parallelism: 1
shell: /bin/bash --login
environment:
LANG: en_US.UTF-8
macos:
xcode: '9.3.0'
steps:
- checkout
- restore_cache:
keys:
- v1-build-{{ .Branch }}-
- run:
name: swift package update
command: swift package update
- run:
name: swift build
command: swift build
- run:
name: swift test
command: swift test
- save_cache:
key: v1-build-{{ .Branch }}-{{ epoch }}
paths:
- .build
- store_test_results:
path: test_output/report.xml
- store_artifacts:
path: /tmp/test-results
destination: scan-test-results
- store_artifacts:
path: ~/Library/Logs/scan
destination: scan-logs
30 changes: 15 additions & 15 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
{
"object": {
"pins": [
{
"package": "danger-swift",
"repositoryURL": "https://github.com/danger/danger-swift.git",
"state": {
"branch": null,
"revision": "dd0d6457adf72eedeb10076e1887d49431fd56a6",
"version": "0.4.0"
}
},
{
"package": "Files",
"repositoryURL": "https://github.com/JohnSundell/Files.git",
"state": {
"branch": null,
"revision": "6171f9e9d8619678da22355560f3dbed6368058d",
"version": "2.0.1"
"revision": "06f95bd1bf4f8d5f50bc6bb30b808c253acd4c88",
"version": "2.2.1"
}
},
{
"package": "Marathon",
"repositoryURL": "https://github.com/JohnSundell/Marathon.git",
"state": {
"branch": null,
"revision": "10d4ae98c9e97ec76d01453781763b2be1cfcec1",
"version": "2.0.2"
"revision": "959e82b044f7dbb2680c6e7cdaa80d70e9dfa4ca",
"version": "3.0.0"
}
},
{
"package": "Releases",
"repositoryURL": "https://github.com/JohnSundell/Releases.git",
"state": {
"branch": null,
"revision": "0a3c1ba8ce8bb27c02c225979bfd02888b38f0cc",
"version": "2.0.1"
"revision": "e74f0895855b56147cb96f2d45aba3ec37da64fb",
"version": "3.0.0"
}
},
{
Expand Down Expand Up @@ -63,15 +72,6 @@
"revision": "8085c925060b84a1fc0caef444c130da2c8154c3",
"version": "3.0.1"
}
},
{
"package": "danger-swift",
"repositoryURL": "https://github.com/danger/danger-swift.git",
"state": {
"branch": null,
"revision": "d8c089e20dc38022afad29b741d59f60da0262d6",
"version": "0.3.3"
}
}
]
},
Expand Down
6 changes: 3 additions & 3 deletions Tests/DangerSwiftLintTests/DangerSwiftLintTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class DangerSwiftLintTests: XCTestCase {

override func setUp() {
executor = FakeShellExecutor()
// This is for me, testing. Uncomment if you're running tests locally.
// FileManager.default.changeCurrentDirectoryPath("/Users/ash/bin/danger-swiftlint")
let localPath = URL(string: #file)!.deletingLastPathComponent(2).absoluteString
FileManager.default.changeCurrentDirectoryPath(localPath)
Copy link
Owner

Choose a reason for hiding this comment

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

Nice.

danger = parseDangerDSL(at: "./Tests/Fixtures/harness.json")
markdownMessage = nil
}
Expand Down Expand Up @@ -59,7 +59,7 @@ class DangerSwiftLintTests: XCTestCase {
_ = SwiftLint.lint(danger: danger, shellExecutor: executor)

let quoteCharacterSet = CharacterSet(charactersIn: "\"")
let filesExtensions = Set(executor.invocations.dropFirst().flatMap { $0.arguments[2].split(separator: ".").last?.trimmingCharacters(in: quoteCharacterSet) })
let filesExtensions = Set(executor.invocations.dropFirst().compactMap { $0.arguments[2].split(separator: ".").last?.trimmingCharacters(in: quoteCharacterSet) })
XCTAssertEqual(filesExtensions, ["swift"])
}

Expand Down
12 changes: 12 additions & 0 deletions Tests/DangerSwiftLintTests/URL+Utils.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Foundation

extension URL {
func deletingLastPathComponent(_ count: Int) -> URL {
guard count > 0 else { return self }

var newUrl = self
(0...count).forEach { _ in newUrl.deleteLastPathComponent() }

return newUrl
}
}
17 changes: 0 additions & 17 deletions circle.yml

This file was deleted.