nicklockwood / SwiftFormat

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

Wrapping nested calls #1551

Open sjavora opened 9 months ago

sjavora commented 9 months ago

This pattern drives me nuts:

foo(bar(
    a: "blah blah blah",
    b: 1_203_921_309_213
))

I'm trying to find a way to turn that into this:

foo(
    bar(
        a: "blah blah blah",
        b: 1_203_921_309_213
    )
)

but haven't succeeded so far - is there a rule/config that can do this? I haven't seen any older issues about this, so maybe it doesn't bother many people?

nicklockwood commented 9 months ago

@sjavora no, there's currently not an option to enforce this. It would probably make sense as an addition to the wrapArguments rule - just need to think of a good name for it.