diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 0000000000..4e86983614 --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,2 @@ +included: + - Source diff --git a/CHANGELOG.md b/CHANGELOG.md index c5aad71129..58722f7d7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,12 @@ * Improve performance of `TrailingNewlineRule`. [Keith Smiley](https://github.com/keith) +* Configure SwiftLint via a YAML file: + Supports `disabled_rules`, `included` and `excluded`. + Pass a configuration file path to `--config`, defaults to `.swiftlint.yml`. + [JP Simard](https://github.com/jpsim) + [#3](https://github.com/realm/SwiftLint/issues/3) + ##### Bug Fixes * None. diff --git a/README.md b/README.md index 90f1424a9e..bae0e7c5d8 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,12 @@ Using [Homebrew](http://brew.sh/) brew install swiftlint ``` -You can also install SwiftLint by downloading `SwiftLint.pkg` from the [latest GitHub release](https://github.com/realm/SwiftLint/releases/latest) and running it. +You can also install SwiftLint by downloading `SwiftLint.pkg` from the +[latest GitHub release](https://github.com/realm/SwiftLint/releases/latest) and +running it. -You can also build from source by cloning this project and running `make install`. +You can also build from source by cloning this project and running +`make install`. ## Usage @@ -35,7 +38,8 @@ as its contents. ### Atom To integrate SwiftLint with [Atom](https://atom.io/) install the -[`linter-swiftlint`](https://atom.io/packages/linter-swiftlint) package from APM. +[`linter-swiftlint`](https://atom.io/packages/linter-swiftlint) package from +APM. ### Command Line @@ -61,8 +65,23 @@ encouraged. The rules that *are* currently implemented are mostly there as a starting point and are subject to change. -See the [Source/SwiftLintFramework/Rules](Source/SwiftLintFramework/Rules) directory to see the currently -implemented rules. +See the [Source/SwiftLintFramework/Rules](Source/SwiftLintFramework/Rules) +directory to see the currently implemented rules. + +### Configuration + +Configure SwiftLint by adding a `.swiftlint.yml` file from the directory you'll +run SwiftLint from. The following parameters can be configured: + +```yaml +disabled_rules: # rule identifiers to exclude from running + - todo +included: # paths to include during linting. `--path` is ignored if present. takes precendence over `excluded`. + - Source +excluded: # paths to ignore during linting. overridden by `included`. + - Carthage + - Pods +``` ## License diff --git a/Source/SwiftLintFramework/Configuration.swift b/Source/SwiftLintFramework/Configuration.swift new file mode 100644 index 0000000000..2e33bd786f --- /dev/null +++ b/Source/SwiftLintFramework/Configuration.swift @@ -0,0 +1,103 @@ +// +// Configuration.swift +// SwiftLint +// +// Created by JP Simard on 2015-08-23. +// Copyright (c) 2015 Realm. All rights reserved. +// + +import Yaml + +extension Yaml { + var arrayOfStrings: [Swift.String]? { + return array?.flatMap { $0.string } + } +} + +public struct Configuration { + public let disabledRules: [String] // disabled_rules + public let included: [String] // included + public let excluded: [String] // excluded + + public var rules: [Rule] { + return allRules.filter { !disabledRules.contains($0.identifier) } + } + + public init?(disabledRules: [String] = [], included: [String] = [], excluded: [String] = []) { + self.disabledRules = disabledRules + self.included = included + self.excluded = excluded + + // Validate that all rule identifiers map to a defined rule + + let validRuleIdentifiers = allRules.map { $0.identifier } + + let ruleSet = Set(disabledRules) + let invalidRules = ruleSet.filter({ !validRuleIdentifiers.contains($0) }) + if invalidRules.count > 0 { + for invalidRule in invalidRules { + fputs("config error: '\(invalidRule)' is not a valid rule identifier\n", stderr) + let listOfValidRuleIdentifiers = "\n".join(validRuleIdentifiers) + fputs("Valid rule identifiers:\n\(listOfValidRuleIdentifiers)\n", stderr) + } + return nil + } + + // Validate that rule identifiers aren't listed multiple times + + if ruleSet.count != disabledRules.count { + let duplicateRules = disabledRules.reduce([String: Int]()) { (var accu, element) in + accu[element] = accu[element]?.successor() ?? 1 + return accu + }.filter { + $0.1 > 1 + } + for duplicateRule in duplicateRules { + fputs("config error: '\(duplicateRule.0)' is listed \(duplicateRule.1) times\n", + stderr) + } + return nil + } + } + + public init?(yaml: String) { + guard let yamlConfig = Yaml.load(yaml).value else { + return nil + } + self.init( + disabledRules: yamlConfig["disabled_rules"].arrayOfStrings ?? [], + included: yamlConfig["included"].arrayOfStrings ?? [], + excluded: yamlConfig["excluded"].arrayOfStrings ?? [] + ) + } + + public init(path: String = ".swiftlint.yml", optional: Bool = true) { + let fullPath = (path as NSString).absolutePathRepresentation() + let failIfRequired = { + if !optional { fatalError("Could not read configuration file at path '\(fullPath)'") } + } + if path.isEmpty { + failIfRequired() + self.init()! + } else { + if !NSFileManager.defaultManager().fileExistsAtPath(fullPath) { + failIfRequired() + self.init()! + return + } + do { + let yamlContents = try NSString(contentsOfFile: fullPath, + encoding: NSUTF8StringEncoding) as String + if let _ = Configuration(yaml: yamlContents) { + print("Loading configuration from '\(path)'") + self.init(yaml: yamlContents)! + } else { + self.init()! + } + } catch { + failIfRequired() + self.init()! + } + } + } +} diff --git a/Source/SwiftLintFramework/Linter.swift b/Source/SwiftLintFramework/Linter.swift index 772869808c..fcafcc94e5 100644 --- a/Source/SwiftLintFramework/Linter.swift +++ b/Source/SwiftLintFramework/Linter.swift @@ -13,24 +13,7 @@ import SourceKittenFramework public struct Linter { private let file: File - private let rules: [Rule] = [ - LineLengthRule(), - LeadingWhitespaceRule(), - TrailingWhitespaceRule(), - ReturnArrowWhitespaceRule(), - TrailingNewlineRule(), - OperatorFunctionWhitespaceRule(), - ForceCastRule(), - FileLengthRule(), - TodoRule(), - ColonRule(), - TypeNameRule(), - VariableNameRule(), - TypeBodyLengthRule(), - FunctionBodyLengthRule(), - NestingRule(), - ControlStatementRule() - ] + private let rules: [Rule] public var styleViolations: [StyleViolation] { return rules.flatMap { $0.validateFile(self.file) } @@ -45,7 +28,8 @@ public struct Linter { :param: file File to lint. */ - public init(file: File) { + public init(file: File, configuration: Configuration = Configuration()!) { self.file = file + rules = configuration.rules } } diff --git a/Source/SwiftLintFramework/Rule.swift b/Source/SwiftLintFramework/Rule.swift index 5f5534e144..8a73f30ec8 100644 --- a/Source/SwiftLintFramework/Rule.swift +++ b/Source/SwiftLintFramework/Rule.swift @@ -18,3 +18,22 @@ public protocol ParameterizedRule: Rule { typealias ParameterType var parameters: [RuleParameter] { get } } + +public let allRules: [Rule] = [ + LineLengthRule(), + LeadingWhitespaceRule(), + TrailingWhitespaceRule(), + ReturnArrowWhitespaceRule(), + TrailingNewlineRule(), + OperatorFunctionWhitespaceRule(), + ForceCastRule(), + FileLengthRule(), + TodoRule(), + ColonRule(), + TypeNameRule(), + VariableNameRule(), + TypeBodyLengthRule(), + FunctionBodyLengthRule(), + NestingRule(), + ControlStatementRule() +] diff --git a/Source/SwiftLintFramework/Rules/LineLengthRule.swift b/Source/SwiftLintFramework/Rules/LineLengthRule.swift index 0171985235..26549e76d3 100644 --- a/Source/SwiftLintFramework/Rules/LineLengthRule.swift +++ b/Source/SwiftLintFramework/Rules/LineLengthRule.swift @@ -23,7 +23,7 @@ public struct LineLengthRule: ParameterizedRule { public func validateFile(file: File) -> [StyleViolation] { return file.contents.lines().flatMap { line in - for parameter in self.parameters.reverse() { + for parameter in parameters.reverse() { if line.content.characters.count > parameter.value { return StyleViolation(type: .Length, location: Location(file: file.path, line: line.index), diff --git a/Source/SwiftLintFramework/Rules/NestingRule.swift b/Source/SwiftLintFramework/Rules/NestingRule.swift index 0af55c31fb..9cad11c87b 100644 --- a/Source/SwiftLintFramework/Rules/NestingRule.swift +++ b/Source/SwiftLintFramework/Rules/NestingRule.swift @@ -35,7 +35,7 @@ public struct NestingRule: ASTRule { public func validateFile(file: File, kind: SwiftDeclarationKind, dictionary: XPCDictionary) -> [StyleViolation] { - return self.validateFile(file, kind: kind, dictionary: dictionary, level: 0) + return validateFile(file, kind: kind, dictionary: dictionary, level: 0) } func validateFile(file: File, diff --git a/Source/SwiftLintFramework/Rules/OperatorFunctionWhitespaceRule.swift b/Source/SwiftLintFramework/Rules/OperatorFunctionWhitespaceRule.swift index 1e87f166ce..ba32d161a8 100644 --- a/Source/SwiftLintFramework/Rules/OperatorFunctionWhitespaceRule.swift +++ b/Source/SwiftLintFramework/Rules/OperatorFunctionWhitespaceRule.swift @@ -25,7 +25,7 @@ public struct OperatorFunctionWhitespaceRule: Rule { return StyleViolation(type: .OperatorFunctionWhitespace, location: Location(file: file, offset: range.location), severity: .Medium, - reason: self.example.ruleDescription) + reason: example.ruleDescription) } } diff --git a/Source/SwiftLintFramework/String+SwiftLint.swift b/Source/SwiftLintFramework/String+SwiftLint.swift index 89c3094da9..7ce54bd765 100644 --- a/Source/SwiftLintFramework/String+SwiftLint.swift +++ b/Source/SwiftLintFramework/String+SwiftLint.swift @@ -24,7 +24,7 @@ extension String { } func countOfTailingCharactersInSet(characterSet: NSCharacterSet) -> Int { - return String(self.characters.reverse()).countOfLeadingCharactersInSet(characterSet) + return String(characters.reverse()).countOfLeadingCharactersInSet(characterSet) } public var chomped: String { @@ -38,13 +38,12 @@ extension NSString { var numberOfLines = 0, index = 0, lineRangeStart = 0, previousIndex = 0 while index < length { numberOfLines++ - if index <= range.location { - lineRangeStart = numberOfLines - previousIndex = index - index = NSMaxRange(self.lineRangeForRange(NSRange(location: index, length: 1))) - } else { + if index > range.location { break } + lineRangeStart = numberOfLines + previousIndex = index + index = NSMaxRange(lineRangeForRange(NSRange(location: index, length: 1))) } return (lineRangeStart, range.location - previousIndex + 1) } diff --git a/Source/SwiftLintFrameworkTests/ConfigurationTests.swift b/Source/SwiftLintFrameworkTests/ConfigurationTests.swift new file mode 100644 index 0000000000..0af7e51e07 --- /dev/null +++ b/Source/SwiftLintFrameworkTests/ConfigurationTests.swift @@ -0,0 +1,50 @@ +// +// ConfigurationTests.swift +// SwiftLint +// +// Created by JP Simard on 8/23/15. +// Copyright © 2015 Realm. All rights reserved. +// + +import SwiftLintFramework +import XCTest + +class ConfigurationTests: XCTestCase { + func testInit() { + XCTAssert(Configuration(yaml: "") != nil, + "initializing Configuration with empty YAML string should succeed") + XCTAssert(Configuration(yaml: "a: 1\nb: 2") != nil, + "initializing Configuration with valid YAML string should succeed") + XCTAssert(Configuration(yaml: "|\na") == nil, + "initializing Configuration with invalid YAML string should fail") + } + + func testEmptyConfiguration() { + guard let config = Configuration(yaml: "") else { + XCTFail("empty YAML string should yield non-nil Configuration") + return + } + XCTAssertEqual(config.disabledRules, []) + XCTAssertEqual(config.included, []) + XCTAssertEqual(config.excluded, []) + } + + func testDisabledRules() { + XCTAssert(Configuration(yaml: "disabled_rules:\n - a") == nil, + "initializing Configuration with invalid rules in YAML string should fail") + let disabledConfig = Configuration(yaml: "disabled_rules:\n - nesting\n - todo")! + XCTAssertEqual(disabledConfig.disabledRules, + ["nesting", "todo"], + "initializing Configuration with valid rules in YAML string should succeed") + let expectedIdentifiers = allRules + .map({ $0.identifier }) + .filter({ !["nesting", "todo"].contains($0) }) + let configuredIdentifiers = disabledConfig.rules.map({ $0.identifier }) + XCTAssertEqual(expectedIdentifiers, configuredIdentifiers) + + // Duplicate + let duplicateConfig = Configuration( yaml: "disabled_rules:\n - todo\n - todo") + XCTAssert(duplicateConfig == nil, "initializing Configuration with duplicate rules in " + + " YAML string should fail") + } +} diff --git a/Source/swiftlint/Components.plist b/Source/swiftlint/Components.plist index 6c7141e761..8d3a3a1b04 100644 --- a/Source/swiftlint/Components.plist +++ b/Source/swiftlint/Components.plist @@ -7,27 +7,6 @@ BundleOverwriteAction upgrade - ChildBundles - - - BundleOverwriteAction - - RootRelativeBundlePath - Library/Frameworks/SwiftLintFramework.framework/Versions/A/Frameworks/SourceKittenFramework.framework - - - BundleOverwriteAction - - RootRelativeBundlePath - Library/Frameworks/SwiftLintFramework.framework/Versions/A/Frameworks/LlamaKit.framework - - - BundleOverwriteAction - - RootRelativeBundlePath - Library/Frameworks/SwiftLintFramework.framework/Versions/A/Frameworks/Commandant.framework - - RootRelativeBundlePath Library/Frameworks/SwiftLintFramework.framework diff --git a/Source/swiftlint/LintCommand.swift b/Source/swiftlint/LintCommand.swift index 469c58b030..3574ed4de5 100644 --- a/Source/swiftlint/LintCommand.swift +++ b/Source/swiftlint/LintCommand.swift @@ -21,36 +21,43 @@ struct LintCommand: CommandType { func run(mode: CommandMode) -> Result<(), CommandantError<()>> { return LintOptions.evaluate(mode).flatMap { options in + let configuration = Configuration(path: options.configurationFile, + optional: !Process.arguments.contains("--config")) if options.useSTDIN { let standardInput = NSFileHandle.fileHandleWithStandardInput() let stdinData = standardInput.readDataToEndOfFile() let stdinNSString = NSString(data: stdinData, encoding: NSUTF8StringEncoding) if let stdinString = stdinNSString as? String { - let violations = Linter(file: File(contents: stdinString)).styleViolations - print("\n".join(violations.map { $0.description })) + let file = File(contents: stdinString) + let linter = Linter(file: file, configuration: configuration) + print("\n".join(linter.styleViolations.map { $0.description })) return .Success() } return .Failure(CommandantError<()>.CommandError()) } // Otherwise parse path. - return self.lint(options.path) + return lint(options.path, configuration: configuration) } } - private func lint(path: String) -> Result<(), CommandantError<()>> { - let filesToLint = filesToLintAtPath(path) + private func lint(path: String, + configuration: Configuration) -> Result<(), CommandantError<()>> { + let filesToLint = (configuration.included.count == 0 ? filesToLintAtPath(path) : []) + .filter({ !configuration.excluded.flatMap(filesToLintAtPath).contains($0) }) + + configuration.included.flatMap(filesToLintAtPath) if filesToLint.count > 0 { - if path == "" { + if path.isEmpty { print("Linting Swift files in current working directory") } else { print("Linting Swift files at path \(path)") } var numberOfViolations = 0, numberOfSeriousViolations = 0 - for (index, file) in filesToLint.enumerate() { - let filename = (file as NSString).lastPathComponent + for (index, path) in filesToLint.enumerate() { + let filename = (path as NSString).lastPathComponent print("Linting '\(filename)' (\(index + 1)/\(filesToLint.count))") - for violation in Linter(file: File(path: file)!).styleViolations { + let file = File(path: path)! + for violation in Linter(file: file, configuration: configuration).styleViolations { print(violation) numberOfViolations++ if violation.severity.isError { @@ -68,19 +75,15 @@ struct LintCommand: CommandType { ) if numberOfSeriousViolations <= 0 { return .Success() - } else { - // This represents failure of the content (i.e. violations in the files linted) - // and not failure of the scanning process itself. The current command architecture - // doesn't discriminate between these types. - return .Failure(CommandantError<()>.CommandError()) } + return .Failure(CommandantError<()>.CommandError()) } return .Failure(CommandantError<()>.UsageError(description: "No lintable files found at" + " path \(path)")) } private func filesToLintAtPath(path: String) -> [String] { - let absolutePath = path.absolutePathRepresentation() + let absolutePath = (path.absolutePathRepresentation() as NSString).stringByStandardizingPath var isDirectory: ObjCBool = false if fileManager.fileExistsAtPath(absolutePath, isDirectory: &isDirectory) { if isDirectory { @@ -98,15 +101,22 @@ struct LintCommand: CommandType { struct LintOptions: OptionsType { let path: String let useSTDIN: Bool + let configurationFile: String - static func create(path: String)(useSTDIN: Bool) -> LintOptions { - return LintOptions(path: path, useSTDIN: useSTDIN) + static func create(path: String)(useSTDIN: Bool)(configurationFile: String) -> LintOptions { + return LintOptions(path: path, useSTDIN: useSTDIN, configurationFile: configurationFile) } static func evaluate(m: CommandMode) -> Result> { return create - <*> m <| Option(key: "path", defaultValue: "", usage: "the path to the file or" + - " directory to lint") - <*> m <| Option(key: "use-stdin", defaultValue: false, usage: "lint standard input") + <*> m <| Option(key: "path", + defaultValue: "", + usage: "the path to the file or directory to lint") + <*> m <| Option(key: "use-stdin", + defaultValue: false, + usage: "lint standard input") + <*> m <| Option(key: "config", + defaultValue: ".swiftlint.yml", + usage: "the path to SwiftLint's configuration file") } } diff --git a/SwiftLint.xcodeproj/project.pbxproj b/SwiftLint.xcodeproj/project.pbxproj index 360b7c4db7..15dd91249a 100644 --- a/SwiftLint.xcodeproj/project.pbxproj +++ b/SwiftLint.xcodeproj/project.pbxproj @@ -19,6 +19,8 @@ D0E7B65619E9C76900EDBA4D /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0D1211B19E87861005E4BAA /* main.swift */; }; E57B23C11B1D8BF000DEA512 /* ReturnArrowWhitespaceRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = E57B23C01B1D8BF000DEA512 /* ReturnArrowWhitespaceRule.swift */; }; E5A167C91B25A0B000CF2D03 /* OperatorFunctionWhitespaceRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A167C81B25A0B000CF2D03 /* OperatorFunctionWhitespaceRule.swift */; }; + E809EDA11B8A71DF00399043 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = E809EDA01B8A71DF00399043 /* Configuration.swift */; }; + E809EDA31B8A73FB00399043 /* ConfigurationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E809EDA21B8A73FB00399043 /* ConfigurationTests.swift */; }; E812249A1B04F85B001783D2 /* TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = E81224991B04F85B001783D2 /* TestHelpers.swift */; }; E812249C1B04FADC001783D2 /* Linter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E812249B1B04FADC001783D2 /* Linter.swift */; }; E832F10B1B17E2F5003F265F /* NSFileManager+SwiftLint.swift in Sources */ = {isa = PBXBuildFile; fileRef = E832F10A1B17E2F5003F265F /* NSFileManager+SwiftLint.swift */; }; @@ -147,6 +149,8 @@ D0E7B63219E9C64500EDBA4D /* swiftlint.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = swiftlint.app; sourceTree = BUILT_PRODUCTS_DIR; }; E57B23C01B1D8BF000DEA512 /* ReturnArrowWhitespaceRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReturnArrowWhitespaceRule.swift; sourceTree = ""; }; E5A167C81B25A0B000CF2D03 /* OperatorFunctionWhitespaceRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OperatorFunctionWhitespaceRule.swift; sourceTree = ""; }; + E809EDA01B8A71DF00399043 /* Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; + E809EDA21B8A73FB00399043 /* ConfigurationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigurationTests.swift; sourceTree = ""; }; E81224991B04F85B001783D2 /* TestHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestHelpers.swift; sourceTree = ""; }; E812249B1B04FADC001783D2 /* Linter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Linter.swift; sourceTree = ""; }; E832F10A1B17E2F5003F265F /* NSFileManager+SwiftLint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSFileManager+SwiftLint.swift"; sourceTree = ""; }; @@ -346,6 +350,7 @@ isa = PBXGroup; children = ( E88DEA8B1B0999A000A66CB0 /* ASTRule.swift */, + E809EDA01B8A71DF00399043 /* Configuration.swift */, 24E17F701B1481FF008195BE /* File+Cache.swift */, E88DEA741B09852000A66CB0 /* File+SwiftLint.swift */, E812249B1B04FADC001783D2 /* Linter.swift */, @@ -385,6 +390,7 @@ isa = PBXGroup; children = ( E8BB8F991B17DDB200199606 /* ASTRuleTests.swift */, + E809EDA21B8A73FB00399043 /* ConfigurationTests.swift */, E832F10C1B17E725003F265F /* IntegrationTests.swift */, E8BB8F9B1B17DE3B00199606 /* StringRuleTests.swift */, E81224991B04F85B001783D2 /* TestHelpers.swift */, @@ -579,7 +585,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n cd Source && swiftlint\nelse\n echo \"SwiftLint not installed. Skipping lint.\"\nfi"; + shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"SwiftLint not installed. Skipping lint.\"\nfi"; }; /* End PBXShellScriptBuildPhase section */ @@ -594,6 +600,7 @@ E57B23C11B1D8BF000DEA512 /* ReturnArrowWhitespaceRule.swift in Sources */, E88DEA841B0990F500A66CB0 /* ColonRule.swift in Sources */, E88DEA791B098D4400A66CB0 /* RuleParameter.swift in Sources */, + E809EDA11B8A71DF00399043 /* Configuration.swift in Sources */, E88DEA731B0984C400A66CB0 /* String+SwiftLint.swift in Sources */, 24E17F721B14BB3F008195BE /* File+Cache.swift in Sources */, E88DEA6D1B09842200A66CB0 /* StyleViolationType.swift in Sources */, @@ -628,6 +635,7 @@ E812249A1B04F85B001783D2 /* TestHelpers.swift in Sources */, E8BB8F9C1B17DE3B00199606 /* StringRuleTests.swift in Sources */, E8BB8F9A1B17DDB200199606 /* ASTRuleTests.swift in Sources */, + E809EDA31B8A73FB00399043 /* ConfigurationTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -696,7 +704,7 @@ "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", ); FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/Source/SwiftLintFramework/Info.plist"; + INFOPLIST_FILE = "Source/SwiftLintFramework/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -728,7 +736,7 @@ "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", ); FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/Source/SwiftLintFramework/Info.plist"; + INFOPLIST_FILE = "Source/SwiftLintFramework/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -798,7 +806,7 @@ "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", ); FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/Source/SwiftLintFramework/Info.plist"; + INFOPLIST_FILE = "Source/SwiftLintFramework/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -854,7 +862,7 @@ "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", ); FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "$(SRCROOT)/Source/SwiftLintFramework/Info.plist"; + INFOPLIST_FILE = "Source/SwiftLintFramework/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -891,7 +899,7 @@ baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "$(SRCROOT)/Source/swiftlint/Info.plist"; + INFOPLIST_FILE = "Source/swiftlint/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/../Frameworks @executable_path/SwiftLintFramework.framework/Versions/Current/Frameworks @executable_path/SwiftLintFramework.framework/Versions/Current/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks /Library/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -903,7 +911,7 @@ baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "$(SRCROOT)/Source/swiftlint/Info.plist"; + INFOPLIST_FILE = "Source/swiftlint/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/../Frameworks @executable_path/SwiftLintFramework.framework/Versions/Current/Frameworks @executable_path/SwiftLintFramework.framework/Versions/Current/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks /Library/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -915,7 +923,7 @@ baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "$(SRCROOT)/Source/swiftlint/Info.plist"; + INFOPLIST_FILE = "Source/swiftlint/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/../Frameworks @executable_path/SwiftLintFramework.framework/Versions/Current/Frameworks @executable_path/SwiftLintFramework.framework/Versions/Current/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks /Library/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -927,7 +935,7 @@ baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "$(SRCROOT)/Source/swiftlint/Info.plist"; + INFOPLIST_FILE = "Source/swiftlint/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/../Frameworks @executable_path/SwiftLintFramework.framework/Versions/Current/Frameworks @executable_path/SwiftLintFramework.framework/Versions/Current/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks /Library/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks /Library/Frameworks/SwiftLintFramework.framework/Versions/Current/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.realm.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)";