nicklockwood / SwiftFormat

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

wraparguments after-first? #1580

Closed MiaShopgal closed 8 months ago

MiaShopgal commented 8 months ago

SwiftFormat for Xcode Version 0.52.8 (1)

given these two functions in the same file, after formatted, why the 2nd method isn't formatted just like the 1st one?

before formatting

func foo(
  bar: Int,
  baz: String
) {

}

func foo(a: Int, b: Int) {

}

after formatting

func foo(bar: Int,
         baz: String) {
}

func foo(a: Int, b: Int) {
}
nicklockwood commented 8 months ago

The rule is only applied to functions that are already wrapped, or which exceed the specified line length.

There have been requests to support wrapping all functions, but that's not implemented yet.

MiaShopgal commented 8 months ago

Roger that. Looking forward to this feature being implemented :)