@@ -29,6 +29,7 @@ public struct Configuration: Codable, Equatable {
2929 case lineBreakBeforeControlFlowKeywords
3030 case lineBreakBeforeEachArgument
3131 case lineBreakBeforeEachGenericRequirement
32+ case lineBreakBeforeEachSwitchCaseOrDefaultBody
3233 case prioritizeKeepingFunctionOutputTogether
3334 case indentConditionalCompilationBlocks
3435 case lineBreakAroundMultilineExpressionChainComponents
@@ -97,6 +98,15 @@ public struct Configuration: Codable, Equatable {
9798 /// horizontally first, with line breaks only being fired when the line length would be exceeded.
9899 public var lineBreakBeforeEachGenericRequirement = false
99100
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+
100110 /// Determines if function-like declaration outputs should be prioritized to be together with the
101111 /// function signature right (closing) parenthesis.
102112 ///
@@ -187,6 +197,8 @@ public struct Configuration: Codable, Equatable {
187197 = try container. decodeIfPresent ( Bool . self, forKey: . lineBreakBeforeEachArgument) ?? false
188198 self . lineBreakBeforeEachGenericRequirement
189199 = try container. decodeIfPresent ( Bool . self, forKey: . lineBreakBeforeEachGenericRequirement) ?? false
200+ self . lineBreakBeforeEachSwitchCaseOrDefaultBody
201+ = try container. decodeIfPresent ( Bool . self, forKey: . lineBreakBeforeEachSwitchCaseOrDefaultBody) ?? false
190202 self . prioritizeKeepingFunctionOutputTogether
191203 = try container. decodeIfPresent ( Bool . self, forKey: . prioritizeKeepingFunctionOutputTogether) ?? false
192204 self . indentConditionalCompilationBlocks
@@ -221,6 +233,7 @@ public struct Configuration: Codable, Equatable {
221233 try container. encode ( lineBreakBeforeControlFlowKeywords, forKey: . lineBreakBeforeControlFlowKeywords)
222234 try container. encode ( lineBreakBeforeEachArgument, forKey: . lineBreakBeforeEachArgument)
223235 try container. encode ( lineBreakBeforeEachGenericRequirement, forKey: . lineBreakBeforeEachGenericRequirement)
236+ try container. encode ( lineBreakBeforeEachSwitchCaseOrDefaultBody, forKey: . lineBreakBeforeEachSwitchCaseOrDefaultBody)
224237 try container. encode ( prioritizeKeepingFunctionOutputTogether, forKey: . prioritizeKeepingFunctionOutputTogether)
225238 try container. encode ( indentConditionalCompilationBlocks, forKey: . indentConditionalCompilationBlocks)
226239 try container. encode (
0 commit comments