Skip to content

Commit 94482c3

Browse files
authored
Merge pull request #94 from allevato/fix-freestanding-inits
Put freestanding `init` decls in a test into a type.
2 parents 116f1f9 + 342df97 commit 94482c3

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

Tests/SwiftFormatRulesTests/ValidateDocumentationCommentsTests.swift

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -187,28 +187,30 @@ public class ValidateDocumentationCommentsTests: DiagnosingTestCase {
187187
public func testInitializer() {
188188
let input =
189189
"""
190-
/// Brief summary.
191-
///
192-
/// - Parameter command: The command to execute in the shell environment.
193-
/// - Returns: Shouldn't be here.
194-
init(label commando: String) {
195-
// ...
196-
}
197-
198-
/// Brief summary.
199-
///
200-
/// - Parameter command: The command to execute in the shell environment.
201-
init(label command: String) {
202-
// ...
203-
}
204-
205-
/// Brief summary.
206-
///
207-
/// - Parameters:
208-
/// - command: The command to execute in the shell environment.
209-
/// - stdin: The string to use as standard input.
210-
init(label command: String, label2 stdin: String) {
211-
// ...
190+
struct SomeType {
191+
/// Brief summary.
192+
///
193+
/// - Parameter command: The command to execute in the shell environment.
194+
/// - Returns: Shouldn't be here.
195+
init(label commando: String) {
196+
// ...
197+
}
198+
199+
/// Brief summary.
200+
///
201+
/// - Parameter command: The command to execute in the shell environment.
202+
init(label command: String) {
203+
// ...
204+
}
205+
206+
/// Brief summary.
207+
///
208+
/// - Parameters:
209+
/// - command: The command to execute in the shell environment.
210+
/// - stdin: The string to use as standard input.
211+
init(label command: String, label2 stdin: String) {
212+
// ...
213+
}
212214
}
213215
"""
214216
performLint(ValidateDocumentationComments.self, input: input)

0 commit comments

Comments
 (0)