Closed ilendemli closed 1 week ago
What's an example that would work correctly with this change?
Currently running the fix argument against a file such as:
import Foundation
enum TestCase: String {
case one = "1"
case two = "2"
case three = "3"
var caseToString: String {
switch self {
case .one:
return "one"
case .two:
return "two"
case .three:
return "three"
}
}
var rawToString: String {
switch rawValue {
case "1":
return "one"
case "2":
return "two"
case "3":
return "three"
}
}
}
does not change anything. With the above change to only exclude SyntaxKind.commentKinds
the file gets corrected to:
import Foundation
enum TestCase: String {
case one = "1"
case two = "2"
case three = "3"
var caseToString: String {
switch self {
case .one:
return "one"
case .two:
return "two"
case .three:
return "three"
}
}
var rawToString: String {
switch rawValue {
case "1":
return "one"
case "2":
return "two"
case "3":
return "three"
}
}
}
Would you like to open a PR to fix this, @ilendemli?
@SimplyDanny https://github.com/realm/SwiftLint/pull/5628
Hi I was applying this ruleset and saw it skip some parts of my code
Regarding this: https://github.com/realm/SwiftLint/blob/b42f6ffe77159aed1060bf607212a0410c7623b8/Source/SwiftLintBuiltInRules/Rules/Style/VerticalWhitespaceBetweenCasesRule.swift#L6
I think it should also apply for String cases and only exclude
SyntaxKind.commentKinds