Merge pull request #555 from realm/nn-use-xcode-select-p-dlsym

Update SourceKitten, SwiftyTextTable and support `swift test`
This commit is contained in:
JP Simard
2016-03-29 17:49:23 -07:00
32 changed files with 48 additions and 255 deletions
+1
View File
@@ -1,4 +1,5 @@
included:
- Source
- Tests
opt_in_rules:
- empty_count
+1 -2
View File
@@ -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
+20
View File
@@ -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
+2 -2
View File
@@ -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"
+2 -2
View File
@@ -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"
+6 -9
View File
@@ -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
+2 -7
View File
@@ -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),
]
)
-23
View File
@@ -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(),
])
+3 -2
View File
@@ -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
)
])
}
}
}
+9 -67
View File
@@ -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 = "<group>"; };
6CB514E81C760C6900FA02C4 /* Structure+SwiftLint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Structure+SwiftLint.swift"; sourceTree = "<group>"; };
6CC4259A1C77046200AEA885 /* SyntaxMap+SwiftLint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SyntaxMap+SwiftLint.swift"; sourceTree = "<group>"; };
6CDD62CE1C6193300094A198 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
83894F211B0C928A006214E1 /* RulesCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RulesCommand.swift; sourceTree = "<group>"; };
83D71E261B131EB5000395DE /* RuleDescription.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RuleDescription.swift; sourceTree = "<group>"; };
B58AEED51C492C7B00E901FD /* ForceUnwrappingRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ForceUnwrappingRule.swift; sourceTree = "<group>"; };
@@ -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 = "<group>";
};
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)";
@@ -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")
@@ -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",
@@ -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
@@ -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("")
@@ -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("")
@@ -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 [
@@ -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],
@@ -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() }
@@ -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)
}
@@ -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 {
@@ -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,