Please describe the rule idea, format
this issue's title as Rule Request: equation sign in same column and describe:
rule will provide better code readability
this should trigger violation
var first = ""
var longVariable = ""
this should NOT trigger violation
var first = ""
var longVariable = ""
probably you should have possibility to set offset threshold to not move short names when one is very very long
this can be in my opinion enabled by default as it not violates
this should definitely be opt-in
well I can agree that not everyone will like such looking code so opt-in is ok for me,
this rule could be useful for auto fix feature, for rapid fix of old code as it only changes spacing
@nysander feel free to open a PR!
well I'm new to swift and this rule I've learned when programming in PHP using manually so unfortunately atm I have no idea where to start how to do such rule for swiftlint. but maybe with some hints I can try
as I've tested my proposal is in conflict with:
few examples in which styling code makes conflicts:
@IBOutlet var titleLabel: UILabel!
@IBOutlet var locationLabel: UILabel!
@IBOutlet var dateLabel: UILabel!
@IBOutlet var descriptionLabel: UILabel!
titleLabel.text = item.title
locationLabel.text = item.location?.name
descriptionLabel.text = item.itemDescription
maybe the solution could be optional configuration for those rules to allow such styling?
Hi @nysander Do you know any tool that would automate this alignment? Iv'e used to use https://github.com/qfish/XAlign in the past, but from Issues it seems that it's not working anymore. On the other hand: https://github.com/nicklockwood/SwiftFormat/issues/359
I've used phpcsfixer long time ago. I do not remember if it has this feature but I liked to have my php code styled this way.
Most helpful comment
this should definitely be opt-in