mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Add testcases to ColonRule.description
This commit is contained in:
@@ -1167,6 +1167,18 @@ object.method(5, y: "string")
|
||||
|
||||
```
|
||||
|
||||
```swift
|
||||
func abc() { def(ghi: jkl) }
|
||||
```
|
||||
|
||||
```swift
|
||||
func abc(def: Void) { ghi(jkl: mno) }
|
||||
```
|
||||
|
||||
```swift
|
||||
class ABC { let def = ghi(jkl: mno) } }
|
||||
```
|
||||
|
||||
</details>
|
||||
<details>
|
||||
<summary>Triggering Examples</summary>
|
||||
@@ -1391,6 +1403,18 @@ object.method(x↓: 5, y: "string")
|
||||
|
||||
```
|
||||
|
||||
```swift
|
||||
func abc() { def(ghi↓:jkl) }
|
||||
```
|
||||
|
||||
```swift
|
||||
func abc(def: Void) { ghi(jkl↓:mno) }
|
||||
```
|
||||
|
||||
```swift
|
||||
class ABC { let def = ghi(jkl↓:mno) } }
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,10 @@ public struct ColonRule: CorrectableRule, ConfigurationProviderRule {
|
||||
"object.method(x: 5, y: \"string\")\n",
|
||||
"object.method(x: 5, y:\n" +
|
||||
" \"string\")",
|
||||
"object.method(5, y: \"string\")\n"
|
||||
"object.method(5, y: \"string\")\n",
|
||||
"func abc() { def(ghi: jkl) }",
|
||||
"func abc(def: Void) { ghi(jkl: mno) }",
|
||||
"class ABC { let def = ghi(jkl: mno) } }"
|
||||
],
|
||||
triggeringExamples: [
|
||||
"let ↓abc:Void\n",
|
||||
@@ -104,7 +107,10 @@ public struct ColonRule: CorrectableRule, ConfigurationProviderRule {
|
||||
"class Foo<↓T : Equatable> {}\n",
|
||||
"object.method(x: 5, y↓ : \"string\")\n",
|
||||
"object.method(x↓:5, y: \"string\")\n",
|
||||
"object.method(x↓: 5, y: \"string\")\n"
|
||||
"object.method(x↓: 5, y: \"string\")\n",
|
||||
"func abc() { def(ghi↓:jkl) }",
|
||||
"func abc(def: Void) { ghi(jkl↓:mno) }",
|
||||
"class ABC { let def = ghi(jkl↓:mno) } }"
|
||||
],
|
||||
corrections: [
|
||||
"let ↓abc:Void\n": "let abc: Void\n",
|
||||
@@ -150,7 +156,10 @@ public struct ColonRule: CorrectableRule, ConfigurationProviderRule {
|
||||
"class Foo<↓T : Equatable> {}\n": "class Foo<T: Equatable> {}\n",
|
||||
"object.method(x: 5, y↓ : \"string\")\n": "object.method(x: 5, y: \"string\")\n",
|
||||
"object.method(x↓:5, y: \"string\")\n": "object.method(x: 5, y: \"string\")\n",
|
||||
"object.method(x↓: 5, y: \"string\")\n": "object.method(x: 5, y: \"string\")\n"
|
||||
"object.method(x↓: 5, y: \"string\")\n": "object.method(x: 5, y: \"string\")\n",
|
||||
"func abc() { def(ghi↓:jkl) }": "func abc() { def(ghi: jkl) }",
|
||||
"func abc(def: Void) { ghi(jkl↓:mno) }": "func abc(def: Void) { ghi(jkl: mno) }",
|
||||
"class ABC { let def = ghi(jkl↓:mno) } }": "class ABC { let def = ghi(jkl: mno) } }"
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user