nicklockwood / SwiftFormat

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

Space around colon (v2) #1467

Open skela opened 1 year ago

skela commented 1 year ago

This is a somewhat similar feature request to what was raised in this issue here https://github.com/nicklockwood/SwiftFormat/issues/1168

Which was addressed here and merged into develop: https://github.com/nicklockwood/SwiftFormat/pull/1335

That seems to be working nicely in the develop branch.

struct NotificationsRequest: RequestProtocol -> struct NotificationsRequest : RequestProtocol

var test : Int = 0 -> var test : Int

let model: SomethingModel = SomethingModel() -> let model : SomethingModel = SomethingModel()

Nice

But it also does it for parameters in functions, which I think makes it not so nice:

func testing(number: Int) -> func testing(number : Int)

SomeStruct(number: Int) -> SomeStruct(number : Int)

Is there anyway to avoid it for the parameters to functions?

nicklockwood commented 1 year ago

Yeah, this is why I haven't landed it in release yet. Needs a rethink.