Skip to content

Commit

Permalink
remove Curry dependency
Browse files Browse the repository at this point in the history
The syntax is going away in Swift 3, and it's not that hard to do ourselves.
  • Loading branch information
jpsim committed Jan 23, 2016
1 parent e12b924 commit 8012fab
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 19 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@
[submodule "Carthage/Checkouts/SourceKitten"]
path = Carthage/Checkouts/SourceKitten
url = https://github.com/jpsim/SourceKitten.git
[submodule "Carthage/Checkouts/Curry"]
path = Carthage/Checkouts/Curry
url = https://github.com/thoughtbot/Curry.git
1 change: 0 additions & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github "Carthage/Commandant"
github "thoughtbot/Curry"
github "jspahrsummers/xcconfigs"
github "behrang/YamlSwift"
1 change: 0 additions & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github "thoughtbot/Curry" "v1.4.0"
github "antitypical/Result" "1.0.1"
github "drmohundro/SWXMLHash" "2.0.6"
github "jpsim/SwiftXPC" "1.1.1"
Expand Down
1 change: 0 additions & 1 deletion Carthage/Checkouts/Curry
Submodule Curry deleted from 370e35
11 changes: 9 additions & 2 deletions Source/swiftlint/Commands/AutoCorrectCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import Commandant
import Curry
import Foundation
import Result
import SourceKittenFramework
Expand Down Expand Up @@ -39,9 +38,17 @@ struct AutoCorrectOptions: OptionsType {
let configurationFile: String
let useScriptInputFiles: Bool

// swiftlint:disable:next line_length
static func create(path: String) -> (configurationFile: String) -> (useScriptInputFiles: Bool) -> AutoCorrectOptions {
return { configurationFile in { useScriptInputFiles in
self.init(path: path, configurationFile: configurationFile,
useScriptInputFiles: useScriptInputFiles)
}}
}

// swiftlint:disable:next line_length
static func evaluate(mode: CommandMode) -> Result<AutoCorrectOptions, CommandantError<CommandantError<()>>> {
return curry(self.init)
return create
<*> mode <| Option(key: "path",
defaultValue: "",
usage: "the path to the file or directory to correct")
Expand Down
12 changes: 9 additions & 3 deletions Source/swiftlint/Commands/LintCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import Commandant
import Curry
import Foundation
import Result
import SourceKittenFramework
Expand Down Expand Up @@ -63,10 +62,17 @@ struct LintOptions: OptionsType {
let strict: Bool
let useScriptInputFiles: Bool

// swiftlint:disable:next line_length
static func create(path: String) -> (useSTDIN: Bool) -> (configurationFile: String) -> (strict: Bool) -> (useScriptInputFiles: Bool) -> LintOptions {
return { useSTDIN in { configurationFile in { strict in { useScriptInputFiles in
self.init(path: path, useSTDIN: useSTDIN, configurationFile: configurationFile,
strict: strict, useScriptInputFiles: useScriptInputFiles)
}}}}
}

// swiftlint:disable:next line_length
static func evaluate(mode: CommandMode) -> Result<LintOptions, CommandantError<CommandantError<()>>> {
let curriedInitializer = curry(self.init)
return curriedInitializer
return create
<*> mode <| Option(key: "path",
defaultValue: "",
usage: "the path to the file or directory to lint")
Expand Down
5 changes: 0 additions & 5 deletions SwiftLint.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
E816194E1BFBFEAB00946723 /* ForceTryRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = E816194D1BFBFEAB00946723 /* ForceTryRule.swift */; };
E81619531BFC162C00946723 /* QueuedPrint.swift in Sources */ = {isa = PBXBuildFile; fileRef = E81619521BFC162C00946723 /* QueuedPrint.swift */; };
E81CDE711C00FEAA00B430F6 /* ValidDocsRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = E81CDE701C00FEAA00B430F6 /* ValidDocsRule.swift */; };
E82161421C138DA900E0CF4F /* Curry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E82161411C138DA900E0CF4F /* Curry.framework */; };
E82161431C138DB200E0CF4F /* Curry.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = E82161411C138DA900E0CF4F /* Curry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E832F10B1B17E2F5003F265F /* NSFileManager+SwiftLint.swift in Sources */ = {isa = PBXBuildFile; fileRef = E832F10A1B17E2F5003F265F /* NSFileManager+SwiftLint.swift */; };
E832F10D1B17E725003F265F /* IntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E832F10C1B17E725003F265F /* IntegrationTests.swift */; };
E83A0B351A5D382B0041A60A /* VersionCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = E83A0B341A5D382B0041A60A /* VersionCommand.swift */; };
Expand Down Expand Up @@ -129,7 +127,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
E82161431C138DB200E0CF4F /* Curry.framework in Copy Frameworks */,
E89376AE1B8A70400025708E /* Yaml.framework in Copy Frameworks */,
E8BA7E141B07A400003E02D0 /* Result.framework in Copy Frameworks */,
E8BA7E151B07A400003E02D0 /* Commandant.framework in Copy Frameworks */,
Expand Down Expand Up @@ -216,7 +213,6 @@
E816194D1BFBFEAB00946723 /* ForceTryRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ForceTryRule.swift; sourceTree = "<group>"; };
E81619521BFC162C00946723 /* QueuedPrint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueuedPrint.swift; sourceTree = "<group>"; };
E81CDE701C00FEAA00B430F6 /* ValidDocsRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidDocsRule.swift; sourceTree = "<group>"; };
E82161411C138DA900E0CF4F /* Curry.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Curry.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E832F10A1B17E2F5003F265F /* NSFileManager+SwiftLint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSFileManager+SwiftLint.swift"; sourceTree = "<group>"; };
E832F10C1B17E725003F265F /* IntegrationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntegrationTests.swift; sourceTree = "<group>"; };
E83A0B341A5D382B0041A60A /* VersionCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VersionCommand.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -272,7 +268,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E82161421C138DA900E0CF4F /* Curry.framework in Frameworks */,
E89376AD1B8A701E0025708E /* Yaml.framework in Frameworks */,
E8BA7E131B07A3F3003E02D0 /* Result.framework in Frameworks */,
E8BA7E111B07A3EC003E02D0 /* Commandant.framework in Frameworks */,
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.

0 comments on commit 8012fab

Please sign in to comment.