How do we style comma delimited guard statements?
Closed this issue · 4 comments
wingchi commented
This can be done in a few ways, for example:
guard
let someVar = someClass.method(),
someOtherVar = someOtherClass.otherMethod()
else { return }
guard
let someVar = someClass.method(),
let someOtherVar = someOtherClass.otherMethod()
else { return }
loganwright commented
Whatever we do here, it should also apply to if
statements. I'm personally partial to the let
on each statement for the way it aligns, but I also like the brevity of omitting it.
+1 for 2 from me
paulrolfe commented
I agree with @loganwright here. I prefer the second one, but both have their merits.
loganwright commented
I think we'll move forward w/ let
on each line. Thanks for the tiebreaker @paulrolfe
alexpersian commented
This is now covered in the style guide, so I'm closing this issue.