Skip to content

Commit

Permalink
Apply small edits to IntegrationTests.swift (realm#2603)
Browse files Browse the repository at this point in the history
* Make constant private
* Avoid force-unwrap
* Allow early return if path is found
  • Loading branch information
jpsim authored Jan 28, 2019
1 parent 2638827 commit 4b3dd7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tests/SwiftLintFrameworkTests/IntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SourceKittenFramework
@testable import SwiftLintFramework
import XCTest

let config: Configuration = {
private let config: Configuration = {
let directory = #file.bridge()
.deletingLastPathComponent.bridge()
.deletingLastPathComponent.bridge()
Expand All @@ -16,7 +16,7 @@ class IntegrationTests: XCTestCase {
func testSwiftLintLints() {
// This is as close as we're ever going to get to a self-hosting linter.
let swiftFiles = config.lintableFiles(inPath: "", forceExclude: false)
XCTAssert(swiftFiles.map({ $0.path! }).contains(#file), "current file should be included")
XCTAssert(swiftFiles.contains(where: { #file == $0.path }), "current file should be included")

let violations = swiftFiles.parallelFlatMap {
Linter(file: $0, configuration: config).styleViolations
Expand Down

0 comments on commit 4b3dd7d

Please sign in to comment.