Skip to content

Commit 0b122bd

Browse files
authored
Merge pull request swiftlang#245 from allevato/fix-linuxmain
Update LinuxMain and the generated pipeline.
2 parents c3c17ad + 493c38a commit 0b122bd

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

Sources/SwiftFormat/Pipelines+Generated.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ class LintPipeline: SyntaxVisitor {
250250

251251
override func visit(_ node: SwitchCaseLabelSyntax) -> SyntaxVisitorContinueKind {
252252
visitIfEnabled(NoLabelsInCasePatterns.visit, for: node)
253-
visitIfEnabled(UseLetInEveryBoundCaseVariable.visit, for: node)
254253
return .visitChildren
255254
}
256255

@@ -282,6 +281,11 @@ class LintPipeline: SyntaxVisitor {
282281
return .visitChildren
283282
}
284283

284+
override func visit(_ node: ValueBindingPatternSyntax) -> SyntaxVisitorContinueKind {
285+
visitIfEnabled(UseLetInEveryBoundCaseVariable.visit, for: node)
286+
return .visitChildren
287+
}
288+
285289
override func visit(_ node: VariableDeclSyntax) -> SyntaxVisitorContinueKind {
286290
visitIfEnabled(AllPublicDeclarationsHaveDocumentation.visit, for: node)
287291
visitIfEnabled(AlwaysUseLowerCamelCase.visit, for: node)

Tests/SwiftFormatPrettyPrintTests/XCTestManifests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ extension CommentTests {
164164
("testDoesNotInsertExtraNewlinesAfterTrailingComments", testDoesNotInsertExtraNewlinesAfterTrailingComments),
165165
("testLineCommentAtEndOfMemberDeclList", testLineCommentAtEndOfMemberDeclList),
166166
("testLineComments", testLineComments),
167+
("testTrailingSpacesInComments", testTrailingSpacesInComments),
167168
]
168169
}
169170

@@ -302,6 +303,7 @@ extension FunctionCallTests {
302303
("testDiscretionaryLineBreakBeforeTrailingClosure", testDiscretionaryLineBreakBeforeTrailingClosure),
303304
("testDiscretionaryLineBreaksAreSelfCorrecting", testDiscretionaryLineBreaksAreSelfCorrecting),
304305
("testGroupsTrailingComma", testGroupsTrailingComma),
306+
("testMultipleTrailingClosures", testMultipleTrailingClosures),
305307
("testNestedFunctionCallExprSequences", testNestedFunctionCallExprSequences),
306308
("testSingleUnlabeledArgumentWithDelimiters", testSingleUnlabeledArgumentWithDelimiters),
307309
]
@@ -728,6 +730,8 @@ extension SwitchStmtTests {
728730
// to regenerate.
729731
static let __allTests__SwitchStmtTests = [
730732
("testBasicSwitch", testBasicSwitch),
733+
("testConditionalCases", testConditionalCases),
734+
("testConditionalCasesIndenting", testConditionalCasesIndenting),
731735
("testLabeledSwitchStmt", testLabeledSwitchStmt),
732736
("testNestedSwitch", testNestedSwitch),
733737
("testNewlinesDisambiguatingWhereClauses", testNewlinesDisambiguatingWhereClauses),
@@ -765,6 +769,7 @@ extension TryCatchTests {
765769
("testDoTryCatch_noBreakBeforeCatch", testDoTryCatch_noBreakBeforeCatch),
766770
("testMultipleCatchItems", testMultipleCatchItems),
767771
("testNestedDo", testNestedDo),
772+
("testTryKeywordBreaking", testTryKeywordBreaking),
768773
]
769774
}
770775

Tests/SwiftFormatRulesTests/XCTestManifests.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extension AlwaysUseLowerCamelCaseTests {
1515
// `swift test --generate-linuxmain`
1616
// to regenerate.
1717
static let __allTests__AlwaysUseLowerCamelCaseTests = [
18+
("testIgnoresUnderscoresInTestNames", testIgnoresUnderscoresInTestNames),
1819
("testInvalidVariableCasing", testInvalidVariableCasing),
1920
]
2021
}
@@ -47,6 +48,7 @@ extension DoNotUseSemicolonsTests {
4748
("testNewlinesAfterSemicolons", testNewlinesAfterSemicolons),
4849
("testSemicolonsInMemberLists", testSemicolonsInMemberLists),
4950
("testSemicolonsInNestedStatements", testSemicolonsInNestedStatements),
51+
("testSemicolonsSeparatingDoWhile", testSemicolonsSeparatingDoWhile),
5052
("testSemicolonUse", testSemicolonUse),
5153
]
5254
}
@@ -216,6 +218,8 @@ extension NoParensAroundConditionsTests {
216218
// to regenerate.
217219
static let __allTests__NoParensAroundConditionsTests = [
218220
("testParensAroundConditions", testParensAroundConditions),
221+
("testParensAroundNestedParenthesizedStatements", testParensAroundNestedParenthesizedStatements),
222+
("testParensAroundNestedUnparenthesizedStatements", testParensAroundNestedUnparenthesizedStatements),
219223
]
220224
}
221225

@@ -245,6 +249,11 @@ extension OneVariableDeclarationPerLineTests {
245249
// `swift test --generate-linuxmain`
246250
// to regenerate.
247251
static let __allTests__OneVariableDeclarationPerLineTests = [
252+
("testCommentPrecedingDeclIsNotRepeated", testCommentPrecedingDeclIsNotRepeated),
253+
("testCommentsPrecedingBindingsAreKept", testCommentsPrecedingBindingsAreKept),
254+
("testInvalidBindingsAreNotDestroyed", testInvalidBindingsAreNotDestroyed),
255+
("testMixedInitializedAndTypedBindings", testMixedInitializedAndTypedBindings),
256+
("testMultipleBindingsWithAccessorsAreCorrected", testMultipleBindingsWithAccessorsAreCorrected),
248257
("testMultipleVariableBindings", testMultipleVariableBindings),
249258
("testNestedVariableBindings", testNestedVariableBindings),
250259
]
@@ -316,7 +325,11 @@ extension UseLetInEveryBoundCaseVariableTests {
316325
// `swift test --generate-linuxmain`
317326
// to regenerate.
318327
static let __allTests__UseLetInEveryBoundCaseVariableTests = [
319-
("testInvalidLetBoundCase", testInvalidLetBoundCase),
328+
("testForCase", testForCase),
329+
("testGuardCase", testGuardCase),
330+
("testIfCase", testIfCase),
331+
("testSwitchCase", testSwitchCase),
332+
("testWhileCase", testWhileCase),
320333
]
321334
}
322335

@@ -398,9 +411,9 @@ extension ValidateDocumentationCommentsTests {
398411
("testInitializer", testInitializer),
399412
("testParameterDocumentation", testParameterDocumentation),
400413
("testParametersName", testParametersName),
401-
("testThrowsDocumentation", testThrowsDocumentation),
402414
("testReturnDocumentation", testReturnDocumentation),
403415
("testSeparateLabelAndIdentifier", testSeparateLabelAndIdentifier),
416+
("testThrowsDocumentation", testThrowsDocumentation),
404417
("testValidDocumentation", testValidDocumentation),
405418
]
406419
}

0 commit comments

Comments
 (0)