Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Update Commandant and SourceKitten, drop Result (realm#2947)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsim authored Nov 7, 2019
1 parent 4513190 commit beaa2a8
Show file tree
Hide file tree
Showing 23 changed files with 25 additions and 50 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "jpsim/SourceKitten" ~> 0.26.0
github "jpsim/SourceKitten" ~> 0.27.0
github "scottrhoyt/SwiftyTextTable" ~> 0.9.0
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -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"
1 change: 0 additions & 1 deletion Carthage/Checkouts/Result
Submodule Result deleted from 2ca499
2 changes: 1 addition & 1 deletion Carthage/Checkouts/SourceKitten
Submodule SourceKitten updated 32 files
+0 −3 .gitmodules
+18 −0 CHANGELOG.md
+1 −1 Cartfile.private
+1 −2 Cartfile.resolved
+1 −1 Carthage/Checkouts/Commandant
+0 −1 Carthage/Checkouts/Result
+1 −1 Makefile
+2 −11 Package.resolved
+1 −1 Package.swift
+1 −1 Source/SourceKittenFramework/Info.plist
+1 −1 Source/SourceKittenFramework/Version.swift
+1 −2 Source/sourcekitten/CompleteCommand.swift
+0 −1 Source/sourcekitten/DocCommand.swift
+0 −1 Source/sourcekitten/FormatCommand.swift
+0 −1 Source/sourcekitten/IndexCommand.swift
+1 −1 Source/sourcekitten/Info.plist
+0 −1 Source/sourcekitten/ModuleInfoCommand.swift
+0 −1 Source/sourcekitten/StructureCommand.swift
+0 −1 Source/sourcekitten/SyntaxCommand.swift
+0 −1 Source/sourcekitten/VersionCommand.swift
+0 −1 Source/sourcekitten/YamlRequestCommand.swift
+0 −3 SourceKitten.xcworkspace/contents.xcworkspacedata
+1,515 −1,430 Tests/SourceKittenFrameworkTests/Fixtures/Commandant@swift-5.0.json
+1,515 −1,430 Tests/SourceKittenFrameworkTests/Fixtures/Commandant@swift-5.1.json
+0 −4,095 Tests/SourceKittenFrameworkTests/Fixtures/CommandantResultTVOS@swift-5.0.json
+0 −4,152 Tests/SourceKittenFrameworkTests/Fixtures/CommandantResultTVOS@swift-5.1.json
+1,515 −1,430 Tests/SourceKittenFrameworkTests/Fixtures/CommandantSPM@swift-5.0.json
+1,515 −1,430 Tests/SourceKittenFrameworkTests/Fixtures/CommandantSPM@swift-5.1.json
+1,515 −1,430 Tests/SourceKittenFrameworkTests/Fixtures/LinuxCommandantSPM@swift-5.0.json
+1,515 −1,430 Tests/SourceKittenFrameworkTests/Fixtures/LinuxCommandantSPM@swift-5.1.json
+0 −7 Tests/SourceKittenFrameworkTests/ModuleTests.swift
+0 −6 sourcekitten.xcodeproj/project.pbxproj
17 changes: 4 additions & 13 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down Expand Up @@ -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"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"))] : []),
Expand Down
1 change: 0 additions & 1 deletion Source/swiftlint/Commands/AnalyzeCommand.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Commandant
import Result
import SwiftLintFramework

struct AnalyzeCommand: CommandProtocol {
Expand Down
1 change: 0 additions & 1 deletion Source/swiftlint/Commands/AutoCorrectCommand.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Commandant
import Result
import SwiftLintFramework

struct AutoCorrectCommand: CommandProtocol {
Expand Down
1 change: 0 additions & 1 deletion Source/swiftlint/Commands/GenerateDocsCommand.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Commandant
import Result
import SwiftLintFramework

struct GenerateDocsCommand: CommandProtocol {
Expand Down
1 change: 0 additions & 1 deletion Source/swiftlint/Commands/LintCommand.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Commandant
import Result

struct LintCommand: CommandProtocol {
let verb = "lint"
Expand Down
1 change: 0 additions & 1 deletion Source/swiftlint/Commands/RulesCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Glibc
#else
#error("Unsupported platform")
#endif
import Result
import SwiftLintFramework
import SwiftyTextTable

Expand Down
1 change: 0 additions & 1 deletion Source/swiftlint/Commands/VersionCommand.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Commandant
import Result
import SwiftLintFramework

struct VersionCommand: CommandProtocol {
Expand Down
6 changes: 2 additions & 4 deletions Source/swiftlint/Extensions/Configuration+CommandLine.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Commandant
import Dispatch
import Foundation
import Result
import SourceKittenFramework
import SwiftLintFramework

Expand All @@ -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() {
Expand All @@ -39,8 +38,7 @@ private func scriptInputFiles() -> Result<[SwiftLintFile], CommandantError<()>>
queuedPrintError(String(describing: error))
return nil
}
}
return Result(inputFiles)
})
}
}

Expand Down
1 change: 0 additions & 1 deletion Source/swiftlint/Helpers/LintOrAnalyzeCommand.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Commandant
import Dispatch
import Foundation
import Result
import SwiftLintFramework

enum LintOrAnalyzeMode {
Expand Down
1 change: 0 additions & 1 deletion Source/swiftlint/Helpers/LintableFilesVisitor.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Commandant
import Foundation
import Result
import SourceKittenFramework
import SwiftLintFramework

Expand Down
6 changes: 0 additions & 6 deletions SwiftLint.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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, ); }; };
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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; };
Expand Down Expand Up @@ -974,7 +970,6 @@
buildActionMask = 2147483647;
files = (
6CB8A80C1D11A7E10052816E /* Commandant.framework in Frameworks */,
6CB8A80D1D11A7E10052816E /* Result.framework in Frameworks */,
D0E7B65319E9C6AD00EDBA4D /* SwiftLintFramework.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1066,7 +1061,6 @@
isa = PBXGroup;
children = (
E8BA7E101B07A3EC003E02D0 /* Commandant.framework */,
E8BA7E121B07A3F3003E02D0 /* Result.framework */,
5499CA961A2394B700783309 /* Components.plist */,
5499CA971A2394B700783309 /* Info.plist */,
);
Expand Down
3 changes: 0 additions & 3 deletions SwiftLint.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions SwiftLintFramework.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion Tests/SwiftLintFrameworkTests/LinterCacheTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit beaa2a8

Please sign in to comment.