Skip to content

Commit

Permalink
prefer 'joined()' over 'joined(separator: "")'
Browse files Browse the repository at this point in the history
since that's the default separator.

Rule for this requested in #1093.
  • Loading branch information
jpsim committed Dec 30, 2016
1 parent e5563ef commit f36e28e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Source/SwiftLintFramework/Reporters/JUnitReporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public struct JUnitReporter: Reporter {
let reason = violation.reason.escapedForXML()
return ["\n\t<testcase classname='Formatting Test' name='\(fileName)\'>\n",
"<failure message='\(reason)\'>" + message + "</failure>",
"\t</testcase>"].joined(separator: "")
}).joined(separator: "") + "\n</testsuite></testsuites>"
"\t</testcase>"].joined()
}).joined() + "\n</testsuite></testsuites>"
}
}
2 changes: 1 addition & 1 deletion Source/SwiftLintFramework/Rules/ClosureSpacingRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public struct ClosureSpacingRule: Rule, ConfigurationProviderRule, OptInRule {
var ranges = [NSRange]()
var bracesAsString = validBraces.map({
file.contents.substring($0.location, length: $0.length)
}).joined(separator: "")
}).joined()
while let foundRange = bracesAsString.range(of: "{}") {
let startIndex = bracesAsString.distance(from: bracesAsString.startIndex,
to: foundRange.lowerBound)
Expand Down
4 changes: 2 additions & 2 deletions Source/SwiftLintFramework/Rules/FileLengthRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public struct FileLengthRule: ConfigurationProviderRule, SourceKitFreeRule {
name: "File Line Length",
description: "Files should not span too many lines.",
nonTriggeringExamples: [
repeatElement("//\n", count: 400).joined(separator: "")
repeatElement("//\n", count: 400).joined()
],
triggeringExamples: [
repeatElement("//\n", count: 401).joined(separator: "")
repeatElement("//\n", count: 401).joined()
]
)

Expand Down

0 comments on commit f36e28e

Please sign in to comment.