Let's take the call to the UIView initializer init(frame:) as an example.
UIView(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize(width: 0, height: 0)))
I have a strong preference for applying linebreaks to this call like so:
UIView(
frame: CGRect(
origin: CGPoint(
x: 0,
y: 0),
size: CGSize(
width: 0,
height: 0)))
I think this is the more readable option, as it is visually reminiscent of a list of bullet points:
However, SwiftFormat currently dictates the following structure:
UIView(
frame: CGRect(
origin: CGPoint(
x: 0,
y: 0
),
size: CGSize(
width: 0,
height: 0
)
)
)
Every line taken up by a single ) adds no extra visual information to the code and is therefore, in my opinion, a waste of space.
I propose exposing this behavior as a rule to allow for customization.
@sebastianfrelle seems reasonable.
@sebastianfrelle (note: while there is currently no way to make SwiftFormat enforce your preferred style, if you wish to allow this style to pass through unmodified, use --disable wrapArguments)
@sebastianfrelle I鈥檝e added a new --closingparen option in 0.35.3 to control this.
@nicklockwood Never got around to saying thank you. I appreciate the work that went into this addition.