@@ -29,6 +29,7 @@ public struct Configuration: Codable, Equatable {
29
29
case lineBreakBeforeControlFlowKeywords
30
30
case lineBreakBeforeEachArgument
31
31
case lineBreakBeforeEachGenericRequirement
32
+ case lineBreakBeforeEachSwitchCaseOrDefaultBody
32
33
case prioritizeKeepingFunctionOutputTogether
33
34
case indentConditionalCompilationBlocks
34
35
case lineBreakAroundMultilineExpressionChainComponents
@@ -97,6 +98,15 @@ public struct Configuration: Codable, Equatable {
97
98
/// horizontally first, with line breaks only being fired when the line length would be exceeded.
98
99
public var lineBreakBeforeEachGenericRequirement = false
99
100
101
+ /// Determines the line-breaking behavior for the bodies of `case` and `default` items within
102
+ /// a `switch` statement.
103
+ ///
104
+ /// If true, a line break will be added after the colon following `case` or `default`, forcing the
105
+ /// body to be on a separate line from the `case` or `default`. If false (the default), these bodies
106
+ /// will be laid out on the same line as the `case` or `default`, with line breaks only being added
107
+ /// when the line length would be exceeded.
108
+ public var lineBreakBeforeEachSwitchCaseOrDefaultBody = false
109
+
100
110
/// Determines if function-like declaration outputs should be prioritized to be together with the
101
111
/// function signature right (closing) parenthesis.
102
112
///
@@ -187,6 +197,8 @@ public struct Configuration: Codable, Equatable {
187
197
= try container. decodeIfPresent ( Bool . self, forKey: . lineBreakBeforeEachArgument) ?? false
188
198
self . lineBreakBeforeEachGenericRequirement
189
199
= try container. decodeIfPresent ( Bool . self, forKey: . lineBreakBeforeEachGenericRequirement) ?? false
200
+ self . lineBreakBeforeEachSwitchCaseOrDefaultBody
201
+ = try container. decodeIfPresent ( Bool . self, forKey: . lineBreakBeforeEachSwitchCaseOrDefaultBody) ?? false
190
202
self . prioritizeKeepingFunctionOutputTogether
191
203
= try container. decodeIfPresent ( Bool . self, forKey: . prioritizeKeepingFunctionOutputTogether) ?? false
192
204
self . indentConditionalCompilationBlocks
@@ -221,6 +233,7 @@ public struct Configuration: Codable, Equatable {
221
233
try container. encode ( lineBreakBeforeControlFlowKeywords, forKey: . lineBreakBeforeControlFlowKeywords)
222
234
try container. encode ( lineBreakBeforeEachArgument, forKey: . lineBreakBeforeEachArgument)
223
235
try container. encode ( lineBreakBeforeEachGenericRequirement, forKey: . lineBreakBeforeEachGenericRequirement)
236
+ try container. encode ( lineBreakBeforeEachSwitchCaseOrDefaultBody, forKey: . lineBreakBeforeEachSwitchCaseOrDefaultBody)
224
237
try container. encode ( prioritizeKeepingFunctionOutputTogether, forKey: . prioritizeKeepingFunctionOutputTogether)
225
238
try container. encode ( indentConditionalCompilationBlocks, forKey: . indentConditionalCompilationBlocks)
226
239
try container. encode (
0 commit comments