@@ -14,33 +14,33 @@ final class BeginDocumentationCommentWithOneLineSummaryTests: LintOrFormatRuleTe
14
14
assertLint (
15
15
BeginDocumentationCommentWithOneLineSummary . self,
16
16
"""
17
- /// Returns a bottle of Dr Pepper from the vending machine.
18
- public func drPepper(from vendingMachine: VendingMachine) -> Soda {}
17
+ /// Returns a bottle of Dr Pepper from the vending machine.
18
+ public func drPepper(from vendingMachine: VendingMachine) -> Soda {}
19
19
20
- /// Contains a comment as description that needs a sentence
21
- /// of two lines of code.
22
- public var twoLinesForOneSentence = " test "
20
+ /// Contains a comment as description that needs a sentence
21
+ /// of two lines of code.
22
+ public var twoLinesForOneSentence = " test "
23
23
24
- /// The background color of the view.
25
- var backgroundColor: UIColor
24
+ /// The background color of the view.
25
+ var backgroundColor: UIColor
26
26
27
- /// Returns the sum of the numbers.
28
- ///
29
- /// - Parameter numbers: The numbers to sum.
30
- /// - Returns: The sum of the numbers.
31
- func sum(_ numbers: [Int]) -> Int {
32
- // ...
33
- }
27
+ /// Returns the sum of the numbers.
28
+ ///
29
+ /// - Parameter numbers: The numbers to sum.
30
+ /// - Returns: The sum of the numbers.
31
+ func sum(_ numbers: [Int]) -> Int {
32
+ // ...
33
+ }
34
34
35
- /// This docline should not succeed.
36
- /// There are two sentences without a blank line between them.
37
- 1️⃣struct Test {}
35
+ /// This docline should not succeed.
36
+ /// There are two sentences without a blank line between them.
37
+ 1️⃣struct Test {}
38
38
39
- /// This docline should not succeed. There are two sentences.
40
- 2️⃣public enum Token { case comma, semicolon, identifier }
39
+ /// This docline should not succeed. There are two sentences.
40
+ 2️⃣public enum Token { case comma, semicolon, identifier }
41
41
42
- /// Should fail because it doesn't have a period
43
- 3️⃣public class testNoPeriod {}
42
+ /// Should fail because it doesn't have a period
43
+ 3️⃣public class testNoPeriod {}
44
44
""" ,
45
45
findings: [
46
46
FindingSpec ( " 1️⃣ " , message: #"add a blank comment line after this sentence: "This docline should not succeed.""# ) ,
@@ -54,36 +54,36 @@ final class BeginDocumentationCommentWithOneLineSummaryTests: LintOrFormatRuleTe
54
54
assertLint (
55
55
BeginDocumentationCommentWithOneLineSummary . self,
56
56
"""
57
- /**
58
- * Returns the numeric value.
59
- *
60
- * - Parameters:
61
- * - digit: The Unicode scalar whose numeric value should be returned.
62
- * - radix: The radix, between 2 and 36, used to compute the numeric value.
63
- * - Returns: The numeric value of the scalar.*/
64
- func numericValue(of digit: UnicodeScalar, radix: Int = 10) -> Int {}
65
-
66
- /**
67
- * This block comment contains a sentence summary
68
- * of two lines of code.
69
- */
70
- public var twoLinesForOneSentence = " test "
71
-
72
- /**
73
- * This block comment should not succeed, struct.
74
- * There are two sentences without a blank line between them.
75
- */
76
- 1️⃣struct TestStruct {}
77
-
78
- /**
79
- This block comment should not succeed, class.
80
- Add a blank comment after the first line.
81
- */
82
- 2️⃣public class TestClass {}
83
- /** This block comment should not succeed, enum. There are two sentences. */
84
- 3️⃣public enum testEnum {}
85
- /** Should fail because it doesn't have a period */
86
- 4️⃣public class testNoPeriod {}
57
+ /**
58
+ * Returns the numeric value.
59
+ *
60
+ * - Parameters:
61
+ * - digit: The Unicode scalar whose numeric value should be returned.
62
+ * - radix: The radix, between 2 and 36, used to compute the numeric value.
63
+ * - Returns: The numeric value of the scalar.*/
64
+ func numericValue(of digit: UnicodeScalar, radix: Int = 10) -> Int {}
65
+
66
+ /**
67
+ * This block comment contains a sentence summary
68
+ * of two lines of code.
69
+ */
70
+ public var twoLinesForOneSentence = " test "
71
+
72
+ /**
73
+ * This block comment should not succeed, struct.
74
+ * There are two sentences without a blank line between them.
75
+ */
76
+ 1️⃣struct TestStruct {}
77
+
78
+ /**
79
+ This block comment should not succeed, class.
80
+ Add a blank comment after the first line.
81
+ */
82
+ 2️⃣public class TestClass {}
83
+ /** This block comment should not succeed, enum. There are two sentences. */
84
+ 3️⃣public enum testEnum {}
85
+ /** Should fail because it doesn't have a period */
86
+ 4️⃣public class testNoPeriod {}
87
87
""" ,
88
88
findings: [
89
89
FindingSpec ( " 1️⃣ " , message: #"add a blank comment line after this sentence: "This block comment should not succeed, struct.""# ) ,
0 commit comments