Fixing line breaks

Also, maybe someone knows how to disable inserting a line-break before $0?

I'd like to keep this API (GitHub - CaptureContext/swift-declarative-configuration: Declarative configuration for your objects)

UIView { $0
  .backgroundColor(.red)
  .layer.scope { $0
    .masksToBounds(true)
    .cornerRadius(12)
  }
}

but swift-format formats the code above to

UIView { 
  $0
    .backgroundColor(.red)
    .layer.scope {
      $0
        .masksToBounds(true)
        .cornerRadius(12)
  }
}
1 Like