Fixed return lines.

This commit is contained in:
Jeremy David Giesbrecht
2017-03-28 23:12:21 -06:00
parent abf2a7218f
commit 433b8e9ba0
2 changed files with 4 additions and 0 deletions
@@ -37,6 +37,7 @@ public struct TrailingCommaRule: ASTRule, CorrectableRule, ConfigurationProvider
// https://bugs.swift.org/browse/SR-3449
result.append("let foo = [\"אבג\", \"αβγ\", \"🇺🇸\"↓,]\n")
#endif
return result
}()
private static let corrections: [String: String] = {
let fixed = triggeringExamples.map { $0.replacingOccurrences(of: "↓,", with: "") }
@@ -44,6 +45,7 @@ public struct TrailingCommaRule: ASTRule, CorrectableRule, ConfigurationProvider
for (triggering, correction) in zip(triggeringExamples, fixed) {
result[triggering] = correction
}
return result
}()
public static let description = RuleDescription(
@@ -39,6 +39,7 @@ class TrailingCommaRuleTests: XCTestCase {
// https://bugs.swift.org/browse/SR-3449
result.append("let foo = [\"אבג\", \"αβγ\",\n\"🇺🇸\"↓]\n")
#endif
return result
}()
private static let corrections: [String: String] = {
let fixed = triggeringExamples.map { $0.replacingOccurrences(of: "", with: ",") }
@@ -46,6 +47,7 @@ class TrailingCommaRuleTests: XCTestCase {
for (triggering, correction) in zip(triggeringExamples, fixed) {
result[triggering] = correction
}
return result
}()
private let mandatoryCommaRuleDescription = RuleDescription(
identifier: TrailingCommaRule.description.identifier,