Add SwiftFormat to the project. (#129)

* Run swiftformat for whitespace.
* Run swiftformat with some rules.
This commit is contained in:
Doug
2022-07-06 14:49:05 +01:00
committed by GitHub
parent 26d8affaa8
commit 02eb4b35e2
188 changed files with 759 additions and 717 deletions
@@ -7,8 +7,8 @@
//
import Foundation
import UIKit
import MatrixRustSDK
import UIKit
struct EmoteRoomMessage: RoomMessageProtocol {
private let message: MatrixRustSDK.EmoteMessage
@@ -6,8 +6,8 @@
// Copyright © 2022 Element. All rights reserved.
//
import UIKit
import MatrixRustSDK
import UIKit
struct ImageRoomMessage: RoomMessageProtocol {
private let message: MatrixRustSDK.ImageMessage
@@ -7,8 +7,8 @@
//
import Foundation
import UIKit
import MatrixRustSDK
import UIKit
struct NoticeRoomMessage: RoomMessageProtocol {
private let message: MatrixRustSDK.NoticeMessage
@@ -7,8 +7,8 @@
//
import Foundation
import UIKit
import MatrixRustSDK
import UIKit
struct TextRoomMessage: RoomMessageProtocol {
private let message: MatrixRustSDK.TextMessage
@@ -6,9 +6,9 @@
// Copyright © 2022 Element. All rights reserved.
//
import Combine
import Foundation
import UIKit
import Combine
struct MockRoomProxy: RoomProxyProtocol {
let id = UUID().uuidString
@@ -29,26 +29,24 @@ struct MockRoomProxy: RoomProxyProtocol {
var callbacks = PassthroughSubject<RoomProxyCallback, Never>()
func loadDisplayNameForUserId(_ userId: String) async -> Result<String?, RoomProxyError> {
return .failure(.failedRetrievingMemberDisplayName)
.failure(.failedRetrievingMemberDisplayName)
}
func loadAvatarURLForUserId(_ userId: String) async -> Result<String?, RoomProxyError> {
return .failure(.failedRetrievingMemberAvatarURL)
.failure(.failedRetrievingMemberAvatarURL)
}
func loadDisplayName() async -> Result<String, RoomProxyError> {
return .failure(.failedRetrievingDisplayName)
.failure(.failedRetrievingDisplayName)
}
func startLiveEventListener() {
}
func startLiveEventListener() { }
func paginateBackwards(count: UInt) async -> Result<Void, RoomProxyError> {
return .failure(.backwardStreamNotAvailable)
.failure(.backwardStreamNotAvailable)
}
func sendMessage(_ message: String) async -> Result<Void, RoomProxyError> {
return .failure(.failedSendingMessage)
.failure(.failedSendingMessage)
}
}
@@ -6,9 +6,9 @@
// Copyright © 2022 Element. All rights reserved.
//
import Combine
import Foundation
import UIKit
import Combine
import MatrixRustSDK
@@ -6,8 +6,8 @@
// Copyright © 2022 Element. All rights reserved.
//
import UIKit
import Combine
import UIKit
enum RoomProxyError: Error {
case failedRetrievingDisplayName
@@ -6,8 +6,8 @@
// Copyright © 2022 Element. All rights reserved.
//
import UIKit
import Combine
import UIKit
struct MockRoomSummary: RoomSummaryProtocol {
var id: String = UUID().uuidString
@@ -18,21 +18,19 @@ struct MockRoomSummary: RoomSummaryProtocol {
var topic: String?
var isDirect: Bool = false
var isDirect = false
var isEncrypted: Bool = false
var isEncrypted = false
var isSpace: Bool = false
var isSpace = false
var isTombstoned: Bool = false
var isTombstoned = false
var lastMessage: EventBrief?
var avatar: UIImage?
func loadDetails() async {
}
func loadDetails() async { }
var callbacks = PassthroughSubject<RoomSummaryCallback, Never>()
}
@@ -6,9 +6,9 @@
// Copyright © 2022 Element. All rights reserved.
//
import Combine
import Foundation
import UIKit
import Combine
class RoomSummary: RoomSummaryProtocol {
private let roomProxy: RoomProxyProtocol
@@ -6,8 +6,8 @@
// Copyright © 2022 Element. All rights reserved.
//
import UIKit
import Combine
import UIKit
enum RoomSummaryCallback {
case updatedData