SwiftFormat icon indicating copy to clipboard operation
SwiftFormat copied to clipboard

Aligning Assignments

Open insha opened this issue 6 years ago • 6 comments

I understand this is not the typical swift format and majority of the code in the wild (at least on GitHub/GitLab) don't align assignments. That said, this is my preferred style because it improves readability.

Therefore, I would like to know if SwiftFormat can align assignments, as in the following example:

func buildDeathStar() -> DeathStar
{
    let capacity            = 25_000
    let isIndistructable    = false
    let hasOnlyOneWeakPoint = true
    
    ...
}

insha avatar Aug 09 '19 13:08 insha

+1

tom-curley avatar Feb 23 '22 10:02 tom-curley

+2

MarkBuchanan avatar May 26 '22 23:05 MarkBuchanan

+3

derKlinke avatar May 30 '22 07:05 derKlinke

+4

keba76 avatar Aug 15 '22 08:08 keba76

+5

Patmei-IDS avatar Jan 17 '23 09:01 Patmei-IDS

translatesAutoresizingMaskIntoConstraints   = false
text                                        = "My Text"
isEnabled                                   = true

I really don't get how people think this improves readability. Is it beautiful aesthetically? Yes. As almost all symmetrical things. Does it make you read faster? I don't think so.

kafran avatar Feb 14 '23 12:02 kafran