mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
b619154905
* Automatically enforce min Swift version for all rules * Fix violations
74 lines
2.7 KiB
Swift
74 lines
2.7 KiB
Swift
internal struct VerticalParameterAlignmentRuleExamples {
|
|
static let nonTriggeringExamples: [Example] = [
|
|
Example("""
|
|
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
|
|
dictionary: SourceKittenDictionary) { }
|
|
"""),
|
|
Example("""
|
|
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
|
|
dictionary: SourceKittenDictionary) -> [StyleViolation]
|
|
"""),
|
|
Example("""
|
|
func foo(bar: Int)
|
|
"""),
|
|
Example("""
|
|
func foo(bar: Int) -> String
|
|
"""),
|
|
Example("""
|
|
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
|
|
dictionary: SourceKittenDictionary)
|
|
-> [StyleViolation]
|
|
"""),
|
|
Example("""
|
|
func validateFunction(
|
|
_ file: SwiftLintFile, kind: SwiftDeclarationKind,
|
|
dictionary: SourceKittenDictionary) -> [StyleViolation]
|
|
"""),
|
|
Example("""
|
|
func validateFunction(
|
|
_ file: SwiftLintFile, kind: SwiftDeclarationKind,
|
|
dictionary: SourceKittenDictionary
|
|
) -> [StyleViolation]
|
|
"""),
|
|
Example("""
|
|
func regex(_ pattern: String,
|
|
options: NSRegularExpression.Options = [.anchorsMatchLines,
|
|
.dotMatchesLineSeparators]) -> NSRegularExpression
|
|
"""),
|
|
Example("""
|
|
func foo(a: Void,
|
|
b: [String: String] =
|
|
[:]) {
|
|
}
|
|
"""),
|
|
Example("""
|
|
func foo(data: (size: CGSize,
|
|
identifier: String)) {}
|
|
"""),
|
|
Example("""
|
|
func foo(data: Data,
|
|
@ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
|
|
""")
|
|
]
|
|
|
|
static let triggeringExamples: [Example] = [
|
|
Example("""
|
|
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
|
|
↓dictionary: SourceKittenDictionary) { }
|
|
"""),
|
|
Example("""
|
|
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
|
|
↓dictionary: SourceKittenDictionary) { }
|
|
"""),
|
|
Example("""
|
|
func validateFunction(_ file: SwiftLintFile,
|
|
↓kind: SwiftDeclarationKind,
|
|
↓dictionary: SourceKittenDictionary) { }
|
|
"""),
|
|
Example("""
|
|
func foo(data: Data,
|
|
↓@ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
|
|
""")
|
|
]
|
|
}
|