This repository was archived by the owner on Jan 10, 2023. It is now read-only.
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Unexpected newline before opening brace for method calls with trailing closures #266
Open
Description
I tried formatting the project I'm working on with swift-format
(using default configuration with 4-space indentation) and noticed that the following code:
return Presentation(editProduct, style: .modalOrFlip)
.onValue {
$0.map { self.libraryStore.edit(.add(.product($0))) }
}
.onPresent {
isEditingLibrary.value = true
}
is formatted as
return Presentation(editProduct, style: .modalOrFlip)
.onValue
{
$0.map { self.libraryStore.edit(.add(.product($0))) }
}
.onPresent
{
isEditingLibrary.value = true
}
As I understand, this is done according to the rule 5 in the Line Wrapping section of the Swift Style Guide. In my opinion, however, newlines before opening braces are unnecessary in this case and should not be added.
Metadata
Metadata
Assignees
Labels
No labels