@@ -7,12 +7,35 @@ final class LineLengthRuleTests: SwiftLintTestCase {
77 " c: String, d: String, e: String, f: String, g: String, h: String, i: String, " +
88 " j: String, k: String, l: String, m: String, n: String, o: String, p: String, " +
99 " q: String, r: String, s: String, t: String, u: String, v: String, w: String, " +
10- " x: String, y: String, z: String) { \n " ) ,
10+ " x: String, y: String, z: String) {} \n " ) ,
1111 Example ( " func superDuperLongFunctionDeclaration(a: String, b: String, " +
1212 " c: String, d: String, e: String, f: String, g: String, h: String, i: String, " +
1313 " j: String, k: String, l: String, m: String, n: String, o: String, p: String, " +
1414 " q: String, r: String, s: String, t: String, u: String, v: String, w: String, " +
15- " x: String, y: String, z: String) { \n " ) ,
15+ " x: String, y: String, z: String) {} \n " ) ,
16+ Example ( """
17+ struct S {
18+ public init(a: String, b: String, c: String, d: String, e: String, f: String, \
19+ g: String, h: String, i: String, j: String, k: String, l: String, \
20+ m: String, n: String, o: String, p: String, q: String, r: String, \
21+ s: String, t: String, u: String, v: String, w: String, x: String, \
22+ y: String, z: String) throws {
23+ // ...
24+ }
25+ }
26+ """ ) ,
27+ Example ( """
28+ struct S {
29+ subscript(a: String, b: String, c: String, d: String, e: String, f: String, \
30+ g: String, h: String, i: String, j: String, k: String, l: String, \
31+ m: String, n: String, o: String, p: String, q: String, r: String, \
32+ s: String, t: String, u: String, v: String, w: String, x: String, \
33+ y: String, z: String) -> Int {
34+ // ...
35+ return 0
36+ }
37+ }
38+ """ ) ,
1639 ]
1740
1841 private let longComment = Example ( String ( repeating: " / " , count: 121 ) + " \n " )
@@ -50,8 +73,12 @@ final class LineLengthRuleTests: SwiftLintTestCase {
5073 let nonTriggeringExamples = baseDescription. nonTriggeringExamples + longFunctionDeclarations
5174 let description = baseDescription. with ( nonTriggeringExamples: nonTriggeringExamples)
5275
53- verifyRule ( description, ruleConfiguration: [ " ignores_function_declarations " : true ] ,
54- commentDoesntViolate: false , stringDoesntViolate: false )
76+ verifyRule (
77+ description,
78+ ruleConfiguration: [ " ignores_function_declarations " : true ] ,
79+ commentDoesntViolate: false ,
80+ stringDoesntViolate: false
81+ )
5582 }
5683
5784 func testLineLengthWithIgnoreCommentsEnabled( ) {
0 commit comments