Update Commandant and SourceKitten, drop Result (#2947)

This commit is contained in:
JP Simard
2019-11-07 10:59:16 -08:00
committed by GitHub
parent 45131909bf
commit beaa2a8a87
23 changed files with 25 additions and 50 deletions
-3
View File
@@ -1,6 +1,3 @@
[submodule "Carthage/Checkouts/Result"]
path = Carthage/Checkouts/Result
url = https://github.com/antitypical/Result.git
[submodule "Carthage/Checkouts/SWXMLHash"]
path = Carthage/Checkouts/SWXMLHash
url = https://github.com/drmohundro/SWXMLHash.git
+6
View File
@@ -7,6 +7,12 @@
[PaulTaykalo](https://github.com/PaulTaykalo)
[#2922](https://github.com/realm/SwiftLint/issues/2922)
* Update Commandant dependency to version 0.17.0, removing the
`antitypical/Result` dependency in favor of the Swift standard
library's `Result` type.
[JP Simard](https://github.com/jpsim)
[#623](https://github.com/jpsim/SourceKitten/issues/623)
#### Experimental
* None.
+1 -1
View File
@@ -1,2 +1,2 @@
github "jpsim/SourceKitten" ~> 0.26.0
github "jpsim/SourceKitten" ~> 0.27.0
github "scottrhoyt/SwiftyTextTable" ~> 0.9.0
+1 -1
View File
@@ -1,3 +1,3 @@
github "Carthage/Commandant" ~> 0.16.0
github "Carthage/Commandant" ~> 0.17.0
github "jpsim/Yams" ~> 2.0.0
github "jspahrsummers/xcconfigs" ~> 0.12.0
+2 -3
View File
@@ -1,7 +1,6 @@
github "Carthage/Commandant" "0.16.0"
github "antitypical/Result" "4.1.0"
github "Carthage/Commandant" "0.17.0"
github "drmohundro/SWXMLHash" "5.0.1"
github "jpsim/SourceKitten" "0.26.0"
github "jpsim/SourceKitten" "0.27.0"
github "jpsim/Yams" "2.0.0"
github "jspahrsummers/xcconfigs" "0.12"
github "scottrhoyt/SwiftyTextTable" "0.9.0"
+4 -13
View File
@@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/Carthage/Commandant.git",
"state": {
"branch": null,
"revision": "2cd0210f897fe46c6ce42f52ccfa72b3bbb621a0",
"version": "0.16.0"
"revision": "ab68611013dec67413628ac87c1f29e8427bc8e4",
"version": "0.17.0"
}
},
{
@@ -46,22 +46,13 @@
"version": "2.2.0"
}
},
{
"package": "Result",
"repositoryURL": "https://github.com/antitypical/Result.git",
"state": {
"branch": null,
"revision": "2ca499ba456795616fbc471561ff1d963e6ae160",
"version": "4.1.0"
}
},
{
"package": "SourceKitten",
"repositoryURL": "https://github.com/jpsim/SourceKitten.git",
"state": {
"branch": null,
"revision": "cc1f16acc70630d27498e81078789f5fa55d7463",
"version": "0.26.0"
"revision": "356551fc513eb12ed779bb369f79cf86a3a01599",
"version": "0.27.0"
}
},
{
+2 -2
View File
@@ -14,8 +14,8 @@ let package = Package(
.library(name: "SwiftLintFramework", targets: ["SwiftLintFramework"])
],
dependencies: [
.package(url: "https://github.com/Carthage/Commandant.git", .upToNextMinor(from: "0.16.0")),
.package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.26.0"),
.package(url: "https://github.com/Carthage/Commandant.git", .upToNextMinor(from: "0.17.0")),
.package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.27.0"),
.package(url: "https://github.com/jpsim/Yams.git", from: "2.0.0"),
.package(url: "https://github.com/scottrhoyt/SwiftyTextTable.git", from: "0.9.0"),
] + (addCryptoSwift ? [.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMinor(from: "1.0.0"))] : []),
@@ -1,5 +1,4 @@
import Commandant
import Result
import SwiftLintFramework
struct AnalyzeCommand: CommandProtocol {
@@ -1,5 +1,4 @@
import Commandant
import Result
import SwiftLintFramework
struct AutoCorrectCommand: CommandProtocol {
@@ -1,5 +1,4 @@
import Commandant
import Result
import SwiftLintFramework
struct GenerateDocsCommand: CommandProtocol {
@@ -1,5 +1,4 @@
import Commandant
import Result
struct LintCommand: CommandProtocol {
let verb = "lint"
@@ -6,7 +6,6 @@ import Glibc
#else
#error("Unsupported platform")
#endif
import Result
import SwiftLintFramework
import SwiftyTextTable
@@ -1,5 +1,4 @@
import Commandant
import Result
import SwiftLintFramework
struct VersionCommand: CommandProtocol {
@@ -1,7 +1,6 @@
import Commandant
import Dispatch
import Foundation
import Result
import SourceKittenFramework
import SwiftLintFramework
@@ -28,7 +27,7 @@ private func scriptInputFiles() -> Result<[SwiftLintFile], CommandantError<()>>
}()
return count.flatMap { count in
let inputFiles = (0..<count).compactMap { fileNumber -> SwiftLintFile? in
return .success((0..<count).compactMap { fileNumber in
switch getEnvironmentVariable("SCRIPT_INPUT_FILE_\(fileNumber)") {
case let .success(path):
if path.bridge().isSwiftFile() {
@@ -39,8 +38,7 @@ private func scriptInputFiles() -> Result<[SwiftLintFile], CommandantError<()>>
queuedPrintError(String(describing: error))
return nil
}
}
return Result(inputFiles)
})
}
}
@@ -1,7 +1,6 @@
import Commandant
import Dispatch
import Foundation
import Result
import SwiftLintFramework
enum LintOrAnalyzeMode {
@@ -1,6 +1,5 @@
import Commandant
import Foundation
import Result
import SourceKittenFramework
import SwiftLintFramework
-6
View File
@@ -135,10 +135,8 @@
6C1D763221A4E69600DEF783 /* Request+DisableSourceKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C1D763121A4E69600DEF783 /* Request+DisableSourceKit.swift */; };
6C7045441C6ADA450003F15A /* SourceKitCrashTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C7045431C6ADA450003F15A /* SourceKitCrashTests.swift */; };
6CB8A80C1D11A7E10052816E /* Commandant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8BA7E101B07A3EC003E02D0 /* Commandant.framework */; };
6CB8A80D1D11A7E10052816E /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8BA7E121B07A3F3003E02D0 /* Result.framework */; };
6CC4259B1C77046200AEA885 /* SyntaxMap+SwiftLint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CC4259A1C77046200AEA885 /* SyntaxMap+SwiftLint.swift */; };
6CCFCF2A1CFEF729003239EB /* Commandant.framework in Embed Frameworks into SwiftLintFramework.framework */ = {isa = PBXBuildFile; fileRef = E8BA7E101B07A3EC003E02D0 /* Commandant.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
6CCFCF2C1CFEF72D003239EB /* Result.framework in Embed Frameworks into SwiftLintFramework.framework */ = {isa = PBXBuildFile; fileRef = E8BA7E121B07A3F3003E02D0 /* Result.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
6CCFCF2D1CFEF731003239EB /* SourceKittenFramework.framework in Embed Frameworks into SwiftLintFramework.framework */ = {isa = PBXBuildFile; fileRef = E876BFBD1B07828500114ED5 /* SourceKittenFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
6CCFCF2E1CFEF73A003239EB /* SWXMLHash.framework in Embed Frameworks into SwiftLintFramework.framework */ = {isa = PBXBuildFile; fileRef = E8C0DFCC1AD349DB007EE3D4 /* SWXMLHash.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
6CCFCF2F1CFEF73E003239EB /* SwiftyTextTable.framework in Embed Frameworks into SwiftLintFramework.framework */ = {isa = PBXBuildFile; fileRef = 3BBF2F9C1C640A0F006CD775 /* SwiftyTextTable.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -469,7 +467,6 @@
dstSubfolderSpec = 10;
files = (
6CCFCF2A1CFEF729003239EB /* Commandant.framework in Embed Frameworks into SwiftLintFramework.framework */,
6CCFCF2C1CFEF72D003239EB /* Result.framework in Embed Frameworks into SwiftLintFramework.framework */,
6CCFCF2D1CFEF731003239EB /* SourceKittenFramework.framework in Embed Frameworks into SwiftLintFramework.framework */,
6CCFCF2E1CFEF73A003239EB /* SWXMLHash.framework in Embed Frameworks into SwiftLintFramework.framework */,
6CCFCF2F1CFEF73E003239EB /* SwiftyTextTable.framework in Embed Frameworks into SwiftLintFramework.framework */,
@@ -933,7 +930,6 @@
E8B067801C13E49600E9E13F /* Configuration+CommandLine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Configuration+CommandLine.swift"; sourceTree = "<group>"; };
E8B67C3D1C095E6300FDED8E /* Correction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Correction.swift; sourceTree = "<group>"; };
E8BA7E101B07A3EC003E02D0 /* Commandant.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Commandant.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E8BA7E121B07A3F3003E02D0 /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E8BB8F9B1B17DE3B00199606 /* RulesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RulesTests.swift; sourceTree = "<group>"; };
E8BDE3FE1EDF91B6002EC12F /* RuleList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RuleList.swift; sourceTree = "<group>"; };
E8BE1FCB1E07687400F781C7 /* Yams.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Yams.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -974,7 +970,6 @@
buildActionMask = 2147483647;
files = (
6CB8A80C1D11A7E10052816E /* Commandant.framework in Frameworks */,
6CB8A80D1D11A7E10052816E /* Result.framework in Frameworks */,
D0E7B65319E9C6AD00EDBA4D /* SwiftLintFramework.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1066,7 +1061,6 @@
isa = PBXGroup;
children = (
E8BA7E101B07A3EC003E02D0 /* Commandant.framework */,
E8BA7E121B07A3F3003E02D0 /* Result.framework */,
5499CA961A2394B700783309 /* Components.plist */,
5499CA971A2394B700783309 /* Info.plist */,
);
-3
View File
@@ -10,9 +10,6 @@
<FileRef
location = "group:Carthage/Checkouts/Commandant/Commandant.xcodeproj">
</FileRef>
<FileRef
location = "group:Carthage/Checkouts/Result/Result.xcodeproj">
</FileRef>
<FileRef
location = "group:Carthage/Checkouts/SWXMLHash/SWXMLHash.xcodeproj">
</FileRef>
+2 -2
View File
@@ -8,8 +8,8 @@ Pod::Spec.new do |s|
s.author = { 'JP Simard' => 'jp@jpsim.com' }
s.platform = :osx, '10.10'
s.source_files = 'Source/SwiftLintFramework/**/*.swift'
s.swift_versions = ['4.2', '5.0']
s.swift_versions = ['5.0', '5.1']
s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
s.dependency 'SourceKittenFramework', '~> 0.26.0'
s.dependency 'SourceKittenFramework', '~> 0.27.0'
s.dependency 'Yams', '~> 2.0'
end
@@ -301,7 +301,9 @@ class LinterCacheTests: XCTestCase {
// swiftlint:disable:next function_body_length
func testDetectSwiftVersion() {
#if compiler(>=5.1.1)
#if compiler(>=5.1.2)
let version = "5.1.2"
#elseif compiler(>=5.1.1)
let version = "5.1.1"
#elseif compiler(>=5.1.0)
let version = "5.1.0"