nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.63k stars 623 forks source link

`wrapEnumCases` breaks for associated values when `case` is on different line #1662

Closed MartinP7r closed 2 months ago

MartinP7r commented 3 months ago

The base code is not pretty but valid Swift, but the formatted code is broken in this case:

--enable wrapEnumCases

input

enum SortOrder { case
    asc(String), desc(String)
}

output

enum SortOrder { case
    asc(String)
    desccase String
}
nicklockwood commented 2 months ago

@MartinP7r fixed in 0.53.7 (the formatting is still a bit whack but it should no longer make the code uncompilable)