When a single-line string has interpolation containing a ternary expression, the line will be broken up into multiple lines according to the wrap rule.
In this example it also seems to put the ? operator on its own line which is also not ideal.
Conditions
SwiftFormat 0.49.14
Xcode 14 beta 5
This is an example using default SwiftFormat options, with the following customizations:
--maxwidth 100--wrapternary before-operators
Original
let str = "\(true ? "A really long string here it's really long again I cannot emphasize enough how long this string is" : "Some other string")"
SwiftFormat formatted
let str = "\(true
?
"A really long string here it's really long again I cannot emphasize enough how long this string is"
: "Some other string")"
Issue
wrap
rule.?
operator on its own line which is also not ideal.Conditions
SwiftFormat 0.49.14 Xcode 14 beta 5
This is an example using default SwiftFormat options, with the following customizations:
--maxwidth 100
--wrapternary before-operators
Original
SwiftFormat formatted