diff --git a/.swiftlint.yml b/.swiftlint.yml index dfcd62057..8a8edf96a 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,4 +1,5 @@ included: - Source + - Tests opt_in_rules: - empty_count diff --git a/.travis.yml b/.travis.yml index ac4893aec..d60a46acf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,10 @@ matrix: include: - script: set -o pipefail && script/cibuild | xcpretty env: JOB=Xcode - - script: make spm_test + - script: make spm env: JOB=SPM before_install: - make swift_snapshot_install - - make spm_bootstrap exclude: - script: placeholder # workaround for https://github.com/travis-ci/travis-ci/issues/4681 diff --git a/CHANGELOG.md b/CHANGELOG.md index 887de33ac..c987be3aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +## Master + +##### Breaking + +* None. + +##### Enhancements + +* Now `libclang.dylib` and `sourcekitd.framework` are dynamically loaded at + runtime by SourceKittenFramework to use the versions included in the Xcode + version specified by `xcode-select -p` or custom toolchains. + [Norio Nomura](https://github.com/norio-nomura) + [#167](https://github.com/jpsim/SourceKitten/issues/167) + +##### Bug Fixes + +* Failed to launch swiftlint when Xcode.app was placed at non standard path. + [Norio Nomura](https://github.com/norio-nomura) + [#593](https://github.com/realm/SwiftLint/issues/593) + ## 0.9.2: Multiple Exhaust Codes ##### Breaking diff --git a/Cartfile b/Cartfile index 618ff1f3e..79b2669ca 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "jpsim/SourceKitten" -github "scottrhoyt/SwiftyTextTable" "0.2.1" +github "jpsim/SourceKitten" "0.11.0" +github "scottrhoyt/SwiftyTextTable" "0.3.0" diff --git a/Cartfile.resolved b/Cartfile.resolved index d995e8a6c..1812e9c45 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,7 +1,7 @@ github "antitypical/Result" "1.0.2" github "drmohundro/SWXMLHash" "2.1.0" -github "scottrhoyt/SwiftyTextTable" "0.2.1" +github "scottrhoyt/SwiftyTextTable" "0.3.0" github "behrang/YamlSwift" "1.4.2" github "jspahrsummers/xcconfigs" "0.9" github "Carthage/Commandant" "0.8.3" -github "jpsim/SourceKitten" "0.10.0" +github "jpsim/SourceKitten" "0.11.0" diff --git a/Carthage/Checkouts/SourceKitten b/Carthage/Checkouts/SourceKitten index 5b86c515e..6415bc91f 160000 --- a/Carthage/Checkouts/SourceKitten +++ b/Carthage/Checkouts/SourceKitten @@ -1 +1 @@ -Subproject commit 5b86c515ef22bc81918dd94186f5fe53399ef9b8 +Subproject commit 6415bc91fde389c9b4866e2b61e1189be4c9796c diff --git a/Carthage/Checkouts/SwiftyTextTable b/Carthage/Checkouts/SwiftyTextTable index 086590652..3fe6ead54 160000 --- a/Carthage/Checkouts/SwiftyTextTable +++ b/Carthage/Checkouts/SwiftyTextTable @@ -1 +1 @@ -Subproject commit 0865906521d21114eecedd197102030b1393c220 +Subproject commit 3fe6ead54269d67015e296ddb4d124b80a526ec4 diff --git a/Makefile b/Makefile index 9358b0405..423afd084 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,10 @@ OUTPUT_PACKAGE=SwiftLint.pkg VERSION_STRING=$(shell agvtool what-marketing-version -terse1) COMPONENTS_PLIST=Source/swiftlint/Supporting Files/Components.plist -SWIFT_SNAPSHOT=swift-DEVELOPMENT-SNAPSHOT-2016-02-03-a -SWIFT_BUILD_COMMAND=/Library/Developer/Toolchains/$(SWIFT_SNAPSHOT).xctoolchain/usr/bin/swift build +SWIFT_SNAPSHOT=swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a +SWIFT_COMMAND=/Library/Developer/Toolchains/$(SWIFT_SNAPSHOT).xctoolchain/usr/bin/swift +SWIFT_BUILD_COMMAND=$(SWIFT_COMMAND) build +SWIFT_TEST_COMMAND=$(SWIFT_COMMAND) test .PHONY: all bootstrap clean install package test uninstall @@ -81,17 +83,12 @@ swift_snapshot_install: curl https://swift.org/builds/development/xcode/$(SWIFT_SNAPSHOT)/$(SWIFT_SNAPSHOT)-osx.pkg -o swift.pkg sudo installer -pkg swift.pkg -target / -spm_bootstrap: spm_teardown - curl https://raw.githubusercontent.com/jpsim/SourceKitten/master/script/spm_bootstrap | bash -s $(SWIFT_SNAPSHOT) - -spm_teardown: - curl https://raw.githubusercontent.com/jpsim/SourceKitten/master/script/spm_teardown | bash - spm: $(SWIFT_BUILD_COMMAND) +spm_test: PATH:=/Library/Developer/Toolchains/$(SWIFT_SNAPSHOT).xctoolchain/usr/bin/:$(PATH) spm_test: spm - .build/Debug/SwiftLintFrameworkTests + $(SWIFT_TEST_COMMAND) spm_clean: $(SWIFT_BUILD_COMMAND) --clean diff --git a/Package.swift b/Package.swift index 11d3eb899..a731cc289 100644 --- a/Package.swift +++ b/Package.swift @@ -8,15 +8,10 @@ let package = Package( dependencies: [ .Target(name: "SwiftLintFramework") ]), - Target(name: "SwiftLintFrameworkTests", - dependencies: [ - .Target(name: "SwiftLintFramework") - ]), ], dependencies: [ - .Package(url: "https://github.com/jpsim/SourceKitten.git", majorVersion: 0, minor: 10), + .Package(url: "https://github.com/jpsim/SourceKitten.git", majorVersion: 0, minor: 11), .Package(url: "https://github.com/behrang/YamlSwift.git", majorVersion: 1), - .Package(url: "https://github.com/norio-nomura/swift-corelibs-xctest.git", majorVersion: 0), - .Package(url: "https://github.com/scottrhoyt/SwiftyTextTable.git", majorVersion: 0, minor: 2), + .Package(url: "https://github.com/scottrhoyt/SwiftyTextTable.git", majorVersion: 0, minor: 3), ] ) diff --git a/Source/SwiftLintFrameworkTests/main.swift b/Source/SwiftLintFrameworkTests/main.swift deleted file mode 100644 index f7cd3479a..000000000 --- a/Source/SwiftLintFrameworkTests/main.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// main.swift -// SwiftLint -// -// Created by 野村 憲男 on 2/3/16. -// Copyright © 2016 Realm. All rights reserved. -// - -import XCTest - -XCTMain([ - ConfigurationTests(), - CustomRulesTests(), - ExtendedNSStringTests(), - FunctionBodyLengthRuleTests(), - IntegrationTests(), - ReporterTests(), - RuleConfigurationsTests(), - RulesTests(), - RuleTests(), - YamlSwiftLintTests(), - YamlParserTests(), - ]) diff --git a/Source/swiftlint/Commands/RulesCommand.swift b/Source/swiftlint/Commands/RulesCommand.swift index 4286221c0..da1489cea 100644 --- a/Source/swiftlint/Commands/RulesCommand.swift +++ b/Source/swiftlint/Commands/RulesCommand.swift @@ -90,12 +90,13 @@ extension TextTable { } return nil }() - addRow(ruleID, + addRow([ + ruleID, (rule is OptInRule) ? "yes" : "no", (rule is CorrectableRule) ? "yes" : "no", configuredRule != nil ? "yes" : "no", (configuredRule ?? rule).configurationDescription - ) + ]) } } } diff --git a/SwiftLint.xcodeproj/project.pbxproj b/SwiftLint.xcodeproj/project.pbxproj index b68d08c27..9f1d49b1a 100644 --- a/SwiftLint.xcodeproj/project.pbxproj +++ b/SwiftLint.xcodeproj/project.pbxproj @@ -73,7 +73,6 @@ E86396C71BADAFE6002C9E88 /* ReporterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86396C61BADAFE6002C9E88 /* ReporterTests.swift */; }; E86396C91BADB2B9002C9E88 /* JSONReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86396C81BADB2B9002C9E88 /* JSONReporter.swift */; }; E86396CB1BADB519002C9E88 /* CSVReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86396CA1BADB519002C9E88 /* CSVReporter.swift */; }; - E868473C1A587C6E0043DC65 /* sourcekitd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E868473B1A587C6E0043DC65 /* sourcekitd.framework */; }; E876BFBE1B07828500114ED5 /* SourceKittenFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E876BFBD1B07828500114ED5 /* SourceKittenFramework.framework */; }; E876BFBF1B0782AA00114ED5 /* SourceKittenFramework.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = E876BFBD1B07828500114ED5 /* SourceKittenFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; E87E4A051BFB927C00FCFE46 /* TrailingSemicolonRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = E87E4A041BFB927C00FCFE46 /* TrailingSemicolonRule.swift */; }; @@ -106,7 +105,6 @@ E88DEA8C1B0999A000A66CB0 /* ASTRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = E88DEA8B1B0999A000A66CB0 /* ASTRule.swift */; }; E89376AD1B8A701E0025708E /* Yaml.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E89376AC1B8A701E0025708E /* Yaml.framework */; }; E89376AE1B8A70400025708E /* Yaml.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = E89376AC1B8A701E0025708E /* Yaml.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - E8AB1A2E1A649F2100452012 /* libclang.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E8AB1A2D1A649F2100452012 /* libclang.dylib */; }; E8B067811C13E49600E9E13F /* Configuration+CommandLine.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8B067801C13E49600E9E13F /* Configuration+CommandLine.swift */; }; E8B67C3E1C095E6300FDED8E /* Correction.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8B67C3D1C095E6300FDED8E /* Correction.swift */; }; E8BA7E111B07A3EC003E02D0 /* Commandant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8BA7E101B07A3EC003E02D0 /* Commandant.framework */; }; @@ -202,7 +200,6 @@ 695BE9CE1BDFD92B0071E985 /* CommaRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommaRule.swift; sourceTree = ""; }; 6CB514E81C760C6900FA02C4 /* Structure+SwiftLint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Structure+SwiftLint.swift"; sourceTree = ""; }; 6CC4259A1C77046200AEA885 /* SyntaxMap+SwiftLint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SyntaxMap+SwiftLint.swift"; sourceTree = ""; }; - 6CDD62CE1C6193300094A198 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 83894F211B0C928A006214E1 /* RulesCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RulesCommand.swift; sourceTree = ""; }; 83D71E261B131EB5000395DE /* RuleDescription.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RuleDescription.swift; sourceTree = ""; }; B58AEED51C492C7B00E901FD /* ForceUnwrappingRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ForceUnwrappingRule.swift; sourceTree = ""; }; @@ -303,8 +300,6 @@ E8BA7E131B07A3F3003E02D0 /* Result.framework in Frameworks */, E8BA7E111B07A3EC003E02D0 /* Commandant.framework in Frameworks */, E876BFBE1B07828500114ED5 /* SourceKittenFramework.framework in Frameworks */, - E8AB1A2E1A649F2100452012 /* libclang.dylib in Frameworks */, - E868473C1A587C6E0043DC65 /* sourcekitd.framework in Frameworks */, E8C0DFCD1AD349DB007EE3D4 /* SWXMLHash.framework in Frameworks */, 3BBF2F9D1C640A0F006CD775 /* SwiftyTextTable.framework in Frameworks */, ); @@ -494,7 +489,6 @@ D0D1212219E878CC005E4BAA /* Configuration */, D0D1217C19E87B05005E4BAA /* Supporting Files */, 3B12C9BE1C3209AC000B423F /* Resources */, - 6CDD62CE1C6193300094A198 /* main.swift */, E809EDA21B8A73FB00399043 /* ConfigurationTests.swift */, D4348EE91C46122C007707FB /* FunctionBodyLengthRuleTests.swift */, E832F10C1B17E725003F265F /* IntegrationTests.swift */, @@ -509,7 +503,7 @@ 3BB47D861C51DE6E00AE6A10 /* CustomRulesTests.swift */, ); name = SwiftLintFrameworkTests; - path = Source/SwiftLintFrameworkTests; + path = Tests/SwiftLintFramework; sourceTree = ""; }; D0D1217C19E87B05005E4BAA /* Supporting Files */ = { @@ -979,17 +973,9 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = "Source/SwiftLintFramework/Supporting Files/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); + LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SwiftLintFramework; VERSIONING_SYSTEM = "apple-generic"; @@ -1011,17 +997,9 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = "Source/SwiftLintFramework/Supporting Files/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); + LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SwiftLintFramework; VERSIONING_SYSTEM = "apple-generic"; @@ -1038,11 +1016,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - INFOPLIST_FILE = "Source/SwiftLintFrameworkTests/Supporting Files/Info.plist"; + INFOPLIST_FILE = "Tests/SwiftLintFramework/Supporting Files/Info.plist"; OTHER_SWIFT_FLAGS = "-D SWIFTLINT_XCODE_VERSION_$(XCODE_VERSION_MINOR)"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SwiftLintFrameworkTests; @@ -1053,11 +1027,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - INFOPLIST_FILE = "Source/SwiftLintFrameworkTests/Supporting Files/Info.plist"; + INFOPLIST_FILE = "Tests/SwiftLintFramework/Supporting Files/Info.plist"; OTHER_SWIFT_FLAGS = "-D SWIFTLINT_XCODE_VERSION_$(XCODE_VERSION_MINOR)"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SwiftLintFrameworkTests; @@ -1083,17 +1053,9 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = "Source/SwiftLintFramework/Supporting Files/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); + LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SwiftLintFramework; VERSIONING_SYSTEM = "apple-generic"; @@ -1110,11 +1072,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - INFOPLIST_FILE = "Source/SwiftLintFrameworkTests/Supporting Files/Info.plist"; + INFOPLIST_FILE = "Tests/SwiftLintFramework/Supporting Files/Info.plist"; OTHER_SWIFT_FLAGS = "-D SWIFTLINT_XCODE_VERSION_$(XCODE_VERSION_MINOR)"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SwiftLintFrameworkTests; @@ -1140,17 +1098,9 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = "Source/SwiftLintFramework/Supporting Files/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); + LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SwiftLintFramework; VERSIONING_SYSTEM = "apple-generic"; @@ -1167,11 +1117,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - INFOPLIST_FILE = "Source/SwiftLintFrameworkTests/Supporting Files/Info.plist"; + INFOPLIST_FILE = "Tests/SwiftLintFramework/Supporting Files/Info.plist"; OTHER_SWIFT_FLAGS = "-D SWIFTLINT_XCODE_VERSION_$(XCODE_VERSION_MINOR)"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SwiftLintFrameworkTests; @@ -1182,7 +1128,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "Source/swiftlint/Supporting Files/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; @@ -1194,7 +1139,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "Source/swiftlint/Supporting Files/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; @@ -1206,7 +1150,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "Source/swiftlint/Supporting Files/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; @@ -1218,7 +1161,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "Source/swiftlint/Supporting Files/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; diff --git a/Source/SwiftLintFrameworkTests/ConfigurationTests.swift b/Tests/SwiftLintFramework/ConfigurationTests.swift similarity index 89% rename from Source/SwiftLintFrameworkTests/ConfigurationTests.swift rename to Tests/SwiftLintFramework/ConfigurationTests.swift index 5b0534d8c..d1d3ff8f9 100644 --- a/Source/SwiftLintFrameworkTests/ConfigurationTests.swift +++ b/Tests/SwiftLintFramework/ConfigurationTests.swift @@ -25,27 +25,6 @@ extension Configuration { class ConfigurationTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testInit", self.testInit), - ("testEmptyConfiguration", self.testEmptyConfiguration), - ("testWhitelistRules", self.testWhitelistRules), - ("testOtherRuleConfigurationsAlongsideWhitelistRules", - self.testOtherRuleConfigurationsAlongsideWhitelistRules), - ("testDisabledRules", self.testDisabledRules), - ("testDisabledRulesWithUnknownRule", self.testDisabledRulesWithUnknownRule), - ("testExcludedPaths", self.testExcludedPaths), - ("testIsEqualTo", self.testIsEqualTo), - ("testIsNotEqualTo", self.testIsNotEqualTo), - ("testMerge", self.testMerge), - ("testLevel0", self.testLevel0), - ("testLevel1", self.testLevel1), - ("testLevel2", self.testLevel2), - ("testLevel3", self.testLevel3), - ("testConfiguresCorrectlyFromDict", self.testConfiguresCorrectlyFromDict), - ("testConfigureFallsBackCorrectly", self.testConfigureFallsBackCorrectly), - ] - func testInit() { XCTAssert(Configuration(dict: [:]) != nil, "initializing Configuration with empty Dictionary should succeed") diff --git a/Source/SwiftLintFrameworkTests/CustomRulesTests.swift b/Tests/SwiftLintFramework/CustomRulesTests.swift similarity index 87% rename from Source/SwiftLintFrameworkTests/CustomRulesTests.swift rename to Tests/SwiftLintFramework/CustomRulesTests.swift index 752d43efe..3c023fa35 100644 --- a/Source/SwiftLintFrameworkTests/CustomRulesTests.swift +++ b/Tests/SwiftLintFramework/CustomRulesTests.swift @@ -13,13 +13,6 @@ import SourceKittenFramework class CustomRulesTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testCustomRuleConfigurationSetsCorrectly", self.testCustomRuleConfigurationSetsCorrectly), - ("testCustomRuleConfigurationThrows", self.testCustomRuleConfigurationThrows), - ("testCustomRules", self.testCustomRules), - ] - func testCustomRuleConfigurationSetsCorrectly() { let configDict = ["my_custom_rule": ["name": "MyCustomRule", "message": "Message", diff --git a/Source/SwiftLintFrameworkTests/ExtendedNSStringTests.swift b/Tests/SwiftLintFramework/ExtendedNSStringTests.swift similarity index 81% rename from Source/SwiftLintFrameworkTests/ExtendedNSStringTests.swift rename to Tests/SwiftLintFramework/ExtendedNSStringTests.swift index bc8cf0cf1..ab4792518 100644 --- a/Source/SwiftLintFrameworkTests/ExtendedNSStringTests.swift +++ b/Tests/SwiftLintFramework/ExtendedNSStringTests.swift @@ -11,12 +11,6 @@ import XCTest class ExtendedNSStringTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testLineAndCharacterForByteOffset_forContentsContainingMultibyteCharacters", - self.testLineAndCharacterForByteOffset_forContentsContainingMultibyteCharacters) - ] - func testLineAndCharacterForByteOffset_forContentsContainingMultibyteCharacters() { let contents = "" + "import Foundation\n" + // 18 characters diff --git a/Source/SwiftLintFrameworkTests/FunctionBodyLengthRuleTests.swift b/Tests/SwiftLintFramework/FunctionBodyLengthRuleTests.swift similarity index 89% rename from Source/SwiftLintFrameworkTests/FunctionBodyLengthRuleTests.swift rename to Tests/SwiftLintFramework/FunctionBodyLengthRuleTests.swift index 7c03b8c96..1e4d5d817 100644 --- a/Source/SwiftLintFrameworkTests/FunctionBodyLengthRuleTests.swift +++ b/Tests/SwiftLintFramework/FunctionBodyLengthRuleTests.swift @@ -15,14 +15,6 @@ private func funcWithBody(body: String) -> String { class FunctionBodyLengthRuleTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testFunctionBodyLengths", self.testFunctionBodyLengths), - ("testFunctionBodyLengthsWithComments", self.testFunctionBodyLengthsWithComments), - ("testFunctionBodyLengthsWithMultilineComments", - self.testFunctionBodyLengthsWithMultilineComments), - ] - func testFunctionBodyLengths() { let longFunctionBody = funcWithBody( Repeat(count: 39, repeatedValue: "x = 0\n").joinWithSeparator("") diff --git a/Source/SwiftLintFrameworkTests/IntegrationTests.swift b/Tests/SwiftLintFramework/IntegrationTests.swift similarity index 91% rename from Source/SwiftLintFrameworkTests/IntegrationTests.swift rename to Tests/SwiftLintFramework/IntegrationTests.swift index c90a38b21..c01ae1c7f 100644 --- a/Source/SwiftLintFrameworkTests/IntegrationTests.swift +++ b/Tests/SwiftLintFramework/IntegrationTests.swift @@ -22,11 +22,6 @@ let config: Configuration = { class IntegrationTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testSwiftLintLints", self.testSwiftLintLints), - ] - func testSwiftLintLints() { // This is as close as we're ever going to get to a self-hosting linter. let swiftFiles = config.lintableFilesForPath("") diff --git a/Source/SwiftLintFrameworkTests/ReporterTests.swift b/Tests/SwiftLintFramework/ReporterTests.swift similarity index 90% rename from Source/SwiftLintFrameworkTests/ReporterTests.swift rename to Tests/SwiftLintFramework/ReporterTests.swift index 9d40b835e..108ee355e 100644 --- a/Source/SwiftLintFrameworkTests/ReporterTests.swift +++ b/Tests/SwiftLintFramework/ReporterTests.swift @@ -11,14 +11,6 @@ import XCTest class ReporterTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testXcodeReporter", self.testXcodeReporter), - ("testJSONReporter", self.testJSONReporter), - ("testCSVReporter", self.testCSVReporter), - ("testCheckstyleReporter", self.testCheckstyleReporter), - ] - func generateViolations() -> [StyleViolation] { let location = Location(file: "filename", line: 1, character: 2) return [ diff --git a/Source/SwiftLintFrameworkTests/Resources/ProjectMock/.swiftlint.yml b/Tests/SwiftLintFramework/Resources/ProjectMock/.swiftlint.yml similarity index 100% rename from Source/SwiftLintFrameworkTests/Resources/ProjectMock/.swiftlint.yml rename to Tests/SwiftLintFramework/Resources/ProjectMock/.swiftlint.yml diff --git a/Source/SwiftLintFrameworkTests/Resources/ProjectMock/Level0.swift b/Tests/SwiftLintFramework/Resources/ProjectMock/Level0.swift similarity index 100% rename from Source/SwiftLintFrameworkTests/Resources/ProjectMock/Level0.swift rename to Tests/SwiftLintFramework/Resources/ProjectMock/Level0.swift diff --git a/Source/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level1.swift b/Tests/SwiftLintFramework/Resources/ProjectMock/Level1/Level1.swift similarity index 100% rename from Source/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level1.swift rename to Tests/SwiftLintFramework/Resources/ProjectMock/Level1/Level1.swift diff --git a/Source/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/.swiftlint.yml b/Tests/SwiftLintFramework/Resources/ProjectMock/Level1/Level2/.swiftlint.yml similarity index 100% rename from Source/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/.swiftlint.yml rename to Tests/SwiftLintFramework/Resources/ProjectMock/Level1/Level2/.swiftlint.yml diff --git a/Source/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/Level2.swift b/Tests/SwiftLintFramework/Resources/ProjectMock/Level1/Level2/Level2.swift similarity index 100% rename from Source/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/Level2.swift rename to Tests/SwiftLintFramework/Resources/ProjectMock/Level1/Level2/Level2.swift diff --git a/Source/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/Level3/Level3.swift b/Tests/SwiftLintFramework/Resources/ProjectMock/Level1/Level2/Level3/Level3.swift similarity index 100% rename from Source/SwiftLintFrameworkTests/Resources/ProjectMock/Level1/Level2/Level3/Level3.swift rename to Tests/SwiftLintFramework/Resources/ProjectMock/Level1/Level2/Level3/Level3.swift diff --git a/Source/SwiftLintFrameworkTests/Resources/test.yml b/Tests/SwiftLintFramework/Resources/test.yml similarity index 100% rename from Source/SwiftLintFrameworkTests/Resources/test.yml rename to Tests/SwiftLintFramework/Resources/test.yml diff --git a/Source/SwiftLintFrameworkTests/RuleConfigurationTests.swift b/Tests/SwiftLintFramework/RuleConfigurationTests.swift similarity index 82% rename from Source/SwiftLintFrameworkTests/RuleConfigurationTests.swift rename to Tests/SwiftLintFramework/RuleConfigurationTests.swift index fd9e09ff5..48dcdb166 100644 --- a/Source/SwiftLintFrameworkTests/RuleConfigurationTests.swift +++ b/Tests/SwiftLintFramework/RuleConfigurationTests.swift @@ -12,22 +12,6 @@ import SourceKittenFramework class RuleConfigurationsTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testNameConfigurationSetsCorrectly", self.testNameConfigurationSetsCorrectly), - ("testNameConfigurationThrowsOnBadConfig", self.testNameConfigurationThrowsOnBadConfig), - ("testNameConfigurationMinLengthThreshold", self.testNameConfigurationMinLengthThreshold), - ("testNameConfigurationMaxLengthThreshold", self.testNameConfigurationMaxLengthThreshold), - ("testSeverityConfigurationFromString", self.testSeverityConfigurationFromString), - ("testSeverityConfigurationFromDictionary", self.testSeverityConfigurationFromDictionary), - ("testSeverityConfigurationThrowsOnBadConfig", - self.testSeverityConfigurationThrowsOnBadConfig), - ("testSeverityLevelConfigParams", self.testSeverityLevelConfigParams), - ("testSeverityLevelConfigPartialParams", self.testSeverityLevelConfigPartialParams), - ("testRegexConfigurationThrows", self.testRegexConfigurationThrows), - ("testRegexRuleDescription", self.testRegexRuleDescription), - ] - func testNameConfigurationSetsCorrectly() { let config = [ "min_length": ["warning": 17, "error": 7], "max_length": ["warning": 170, "error": 700], diff --git a/Source/SwiftLintFrameworkTests/RuleTests.swift b/Tests/SwiftLintFramework/RuleTests.swift similarity index 77% rename from Source/SwiftLintFrameworkTests/RuleTests.swift rename to Tests/SwiftLintFramework/RuleTests.swift index f6f4ce32c..37a82409d 100644 --- a/Source/SwiftLintFrameworkTests/RuleTests.swift +++ b/Tests/SwiftLintFramework/RuleTests.swift @@ -21,27 +21,6 @@ struct RuleWithLevelsMock: ConfigurationProviderRule { class RuleTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testRuleIsEqualTo", self.testRuleIsEqualTo), - ("testRuleIsNotEqualTo", self.testRuleIsNotEqualTo), - ("testRuleArraysWithDifferentCountsNotEqual", - self.testRuleArraysWithDifferentCountsNotEqual), - ("testSeverityLevelRuleInitsWithConfigDictionary", - self.testSeverityLevelRuleInitsWithConfigDictionary), - ("testSeverityLevelRuleInitsWithWarningOnlyConfigDictionary", - self.testSeverityLevelRuleInitsWithWarningOnlyConfigDictionary), - ("testSeverityLevelRuleInitsWithErrorOnlyConfigDictionary", - self.testSeverityLevelRuleInitsWithErrorOnlyConfigDictionary), - ("testSeverityLevelRuleInitsWithConfigArray", - self.testSeverityLevelRuleInitsWithConfigArray), - ("testSeverityLevelRuleInitsWithSingleValueConfigArray", - self.testSeverityLevelRuleInitsWithSingleValueConfigArray), - ("testSeverityLevelRuleInitsWithLiteral", self.testSeverityLevelRuleInitsWithLiteral), - ("testSeverityLevelRuleNotEqual", self.testSeverityLevelRuleNotEqual), - ("testDifferentSeverityLevelRulesNotEqual", self.testDifferentSeverityLevelRulesNotEqual), - ] - private struct RuleMock1: Rule { init() {} init(configuration: AnyObject) throws { self.init() } diff --git a/Source/SwiftLintFrameworkTests/RulesTests.swift b/Tests/SwiftLintFramework/RulesTests.swift similarity index 63% rename from Source/SwiftLintFrameworkTests/RulesTests.swift rename to Tests/SwiftLintFramework/RulesTests.swift index a6e1a38e1..d75f28135 100644 --- a/Source/SwiftLintFrameworkTests/RulesTests.swift +++ b/Tests/SwiftLintFramework/RulesTests.swift @@ -11,41 +11,6 @@ import XCTest class RulesTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testClosingBrace", self.testClosingBrace), - ("testColon", self.testColon), - ("testComma", self.testComma), - ("testConditionalBindingCascade", self.testConditionalBindingCascade), - ("testControlStatement", self.testControlStatement), - ("testCyclomaticComplexity", self.testCyclomaticComplexity), - ("testEmptyCount", self.testEmptyCount), - ("testFileLength", self.testFileLength), - ("testForceCast", self.testForceCast), - ("testForceTry", self.testForceTry), - ("testForceUnwrapping", self.testForceUnwrapping), - ("testFunctionBodyLength", self.testFunctionBodyLength), - ("testFunctionParameterCountRule", self.testFunctionParameterCountRule), - ("testLeadingWhitespace", self.testLeadingWhitespace), - ("testLegacyConstant", self.testLegacyConstant), - ("testLegacyConstructor", self.testLegacyConstructor), - ("testLineLength", self.testLineLength), - ("testMissingDocs", self.testMissingDocs), - ("testNesting", self.testNesting), - ("testOpeningBrace", self.testOpeningBrace), - ("testOperatorFunctionWhitespace", self.testOperatorFunctionWhitespace), - ("testReturnArrowWhitespace", self.testReturnArrowWhitespace), - ("testStatementPosition", self.testStatementPosition), - ("testTodo", self.testTodo), - ("testTrailingNewline", self.testTrailingNewline), - ("testTrailingSemicolon", self.testTrailingSemicolon), - ("testTrailingWhitespace", self.testTrailingWhitespace), - ("testTypeBodyLength", self.testTypeBodyLength), - ("testTypeName", self.testTypeName), - ("testValidDocs", self.testValidDocs), - ("testVariableName", self.testVariableName), - ] - func testClosingBrace() { verifyRule(ClosingBraceRule.description) } diff --git a/Source/SwiftLintFrameworkTests/Supporting Files/Info.plist b/Tests/SwiftLintFramework/Supporting Files/Info.plist similarity index 100% rename from Source/SwiftLintFrameworkTests/Supporting Files/Info.plist rename to Tests/SwiftLintFramework/Supporting Files/Info.plist diff --git a/Source/SwiftLintFrameworkTests/TestHelpers.swift b/Tests/SwiftLintFramework/TestHelpers.swift similarity index 100% rename from Source/SwiftLintFrameworkTests/TestHelpers.swift rename to Tests/SwiftLintFramework/TestHelpers.swift diff --git a/Source/SwiftLintFrameworkTests/Yaml+SwiftLintTests.swift b/Tests/SwiftLintFramework/Yaml+SwiftLintTests.swift similarity index 94% rename from Source/SwiftLintFrameworkTests/Yaml+SwiftLintTests.swift rename to Tests/SwiftLintFramework/Yaml+SwiftLintTests.swift index b8228896e..a73d9b3a3 100644 --- a/Source/SwiftLintFrameworkTests/Yaml+SwiftLintTests.swift +++ b/Tests/SwiftLintFramework/Yaml+SwiftLintTests.swift @@ -13,11 +13,6 @@ import Yaml class YamlSwiftLintTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testFlattenYaml", self.testFlattenYaml), - ] - func testFlattenYaml() { let yamlResult = Yaml.load(getTestYaml()) if let error = yamlResult.error { diff --git a/Source/SwiftLintFrameworkTests/YamlParserTests.swift b/Tests/SwiftLintFramework/YamlParserTests.swift similarity index 73% rename from Source/SwiftLintFrameworkTests/YamlParserTests.swift rename to Tests/SwiftLintFramework/YamlParserTests.swift index c556fe059..74d011a98 100644 --- a/Source/SwiftLintFrameworkTests/YamlParserTests.swift +++ b/Tests/SwiftLintFramework/YamlParserTests.swift @@ -11,13 +11,6 @@ import XCTest class YamlParserTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testParseEmptyString", self.testParseEmptyString), - ("testParseValidString", self.testParseValidString), - ("testParseInvalidStringThrows", self.testParseInvalidStringThrows), - ] - // swiftlint:disable force_try func testParseEmptyString() { XCTAssertEqual((try! YamlParser.parse("")).count, 0,