Skip to content

Commit 122fb7e

Browse files
authored
Merge pull request #731 from ahoppen/6.0/merge-main-2024-05-01
Merge `main` into `release/6.0`
2 parents c7912e1 + b0ac22e commit 122fb7e

File tree

12 files changed

+60
-9
lines changed

12 files changed

+60
-9
lines changed

.swiftci/5_10_ubuntu2204

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
LinuxSwiftPackageJob {
2+
swift_version_tag = "5.10-jammy"
3+
repo = "swift-format"
4+
branch = "main"
5+
}

.swiftci/5_7_ubuntu2204

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
LinuxSwiftPackageJob {
2+
swift_version_tag = "5.7-jammy"
3+
repo = "swift-format"
4+
branch = "main"
5+
}

.swiftci/5_8_ubuntu2204

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
LinuxSwiftPackageJob {
2+
swift_version_tag = "5.8-jammy"
3+
repo = "swift-format"
4+
branch = "main"
5+
}

.swiftci/5_9_ubuntu2204

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
LinuxSwiftPackageJob {
2+
swift_version_tag = "5.9-jammy"
3+
repo = "swift-format"
4+
branch = "main"
5+
}

.swiftci/nightly_6_0_macos

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
macOSSwiftPackageJob {
2+
swift_version = "6.0"
3+
repo = "swift-format"
4+
branch = "main"
5+
}

.swiftci/nightly_6_0_ubuntu2204

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
LinuxSwiftPackageJob {
2+
nightly_docker_tag = "nightly-6.0-jammy"
3+
repo = "swift-format"
4+
branch = "main"
5+
}

.swiftci/nightly_main_macos

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
macOSSwiftPackageJob {
2+
swift_version = "main"
3+
repo = "swift-format"
4+
branch = "main"
5+
}

.swiftci/nightly_main_ubuntu2204

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
LinuxSwiftPackageJob {
2+
nightly_docker_tag = "nightly-jammy"
3+
repo = "swift-format"
4+
branch = "main"
5+
}

.swiftci/nightly_main_windows

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
WindowsSwiftPackageWithDockerImageJob {
2+
docker_image = "swiftlang/swift:nightly-windowsservercore-1809"
3+
repo = "swift-format"
4+
branch = "main"
5+
sub_dir = "swift-format"
6+
label = "windows-server-2019"
7+
}

Documentation/RuleDocumentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Use the rules below in the `rules` block of your `.swift-format`
66
configuration file, as described in
7-
[Configuration](Documentation/Configuration.md). All of these rules can be
7+
[Configuration](Configuration.md). All of these rules can be
88
applied in the linter, but only some of them can format your source code
99
automatically.
1010

Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,14 +1350,6 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
13501350
}
13511351

13521352
override func visit(_ node: EnumCaseParameterClauseSyntax) -> SyntaxVisitorContinueKind {
1353-
// Prioritize keeping ") throws -> <return_type>" together. We can only do this if the function
1354-
// has arguments.
1355-
if !node.parameters.isEmpty && config.prioritizeKeepingFunctionOutputTogether {
1356-
// Due to visitation order, this .open corresponds to a .close added in FunctionDeclSyntax
1357-
// or SubscriptDeclSyntax.
1358-
before(node.rightParen, tokens: .open)
1359-
}
1360-
13611353
return .visitChildren
13621354
}
13631355

Tests/SwiftFormatTests/PrettyPrint/EnumDeclTests.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,4 +559,16 @@ final class EnumDeclTests: PrettyPrintTestCase {
559559
let input = "enum Foo { var bar: Int }"
560560
assertPrettyPrintEqual(input: input, expected: input + "\n", linelength: 50)
561561
}
562+
563+
func testEnumWithPrioritizeKeepingFunctionOutputTogetherFlag() {
564+
let input = """
565+
enum Error {
566+
case alreadyOpen(Int)
567+
}
568+
569+
"""
570+
var config = Configuration.forTesting
571+
config.prioritizeKeepingFunctionOutputTogether = true
572+
assertPrettyPrintEqual(input: input, expected: input, linelength: 50, configuration: config)
573+
}
562574
}

0 commit comments

Comments
 (0)