When testing develop on our codebase, I encountered one issue where the open brace of a closure in a guard statement would be wrapped unexpectedly. Here's a test case that fails on develop (which I'd expect to pass):
func testOpenBraceAfterEqualsInGuardNotWrapped() {
let input = """
guard
let foo = foo,
let bar: String = {
nil
}()
else { return }
"""
let options = FormatOptions(
wrapArguments: .beforeFirst,
closingParenOnSameLine: true
)
testFormatting(for: input, rules: [FormatRules.wrapMultilineStatementBraces, FormatRules.wrap],
options: options, exclude: ["indent", "redundantClosure"])
}
When testing
develop
on our codebase, I encountered one issue where the open brace of a closure in aguard
statement would be wrapped unexpectedly. Here's a test case that fails ondevelop
(which I'd expect to pass):here's a commit that includes that test case: https://github.com/calda/SwiftFormat/commit/8d121bfb378a84fed27f1423a6efae156a50a8b4