nicklockwood / SwiftFormat

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

Question: Removing wrap brace rule? #1170

Closed JulesMoorhouse closed 2 years ago

JulesMoorhouse commented 2 years ago

image

How can I turn off new line on braces ?

I thought wrapMultiLineStatementBraces would be the rule, but that doesn't work when I turn on or off in the SwiftFormat app, when using the command from the editor in Xcode, unless I need to restart Xcode after changing rules in the app ?

Thanks.

nicklockwood commented 2 years ago

In swiftformat terminology, "braces" are these "{" and these "(" are called "parens".

I think you want --closingparen same-line

JulesMoorhouse commented 2 years ago

Can I add that in the Swift Format app? Can’t see it or a way to add custom rules

nicklockwood commented 2 years ago

In the SwiftFormat for Xcode extension app, it's listed as an option under the wrapArguments rule:

Screenshot 2022-04-26 at 11 58 28