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
@@ -6,8 +6,8 @@
// Copyright © 2022 Element. All rights reserved.
//
import UIKit
import MatrixRustSDK
import UIKit
@MainActor
protocol AuthenticationCoordinatorDelegate: AnyObject {
@@ -1,4 +1,4 @@
//
//
// Copyright 2022 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,8 +14,8 @@
// limitations under the License.
//
import SwiftUI
import MatrixRustSDK
import SwiftUI
struct LoginCoordinatorParameters {
/// The service used to authenticate the user.
@@ -56,7 +56,7 @@ final class LoginCoordinator: Coordinator, Presentable {
// Must be used only internally
var childCoordinators: [Coordinator] = []
var callback: (@MainActor (LoginCoordinatorAction) -> Void)?
var callback: (@MainActor(LoginCoordinatorAction) -> Void)?
// MARK: - Setup
@@ -73,6 +73,7 @@ final class LoginCoordinator: Coordinator, Presentable {
}
// MARK: - Public
func start() {
MXLog.debug("[LoginCoordinator] did start.")
@@ -1,4 +1,4 @@
//
//
// Copyright 2022 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,4 +1,4 @@
//
//
// Copyright 2022 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -53,7 +53,7 @@ struct LoginViewState: BindableState {
/// Data about the selected homeserver.
var homeserver: LoginHomeserver
/// Whether a new homeserver is currently being loaded.
var isLoading: Bool = false
var isLoading = false
/// View state that can be bound to from SwiftUI.
var bindings: LoginBindings
@@ -24,7 +24,7 @@ class LoginViewModel: LoginViewModelType, LoginViewModelProtocol {
// MARK: Public
var callback: (@MainActor (LoginViewModelAction) -> Void)?
var callback: (@MainActor(LoginViewModelAction) -> Void)?
// MARK: - Setup
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +19,7 @@ import Foundation
@MainActor
protocol LoginViewModelProtocol {
var callback: (@MainActor (LoginViewModelAction) -> Void)? { get set }
var callback: (@MainActor(LoginViewModelAction) -> Void)? { get set }
var context: LoginViewModelType.Context { get }
/// Update the view to reflect that a new homeserver is being loaded.
@@ -1,4 +1,4 @@
//
//
// Copyright 2022 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -46,7 +46,7 @@ final class ServerSelectionCoordinator: Coordinator, Presentable {
// Must be used only internally
var childCoordinators: [Coordinator] = []
var callback: (@MainActor (ServerSelectionCoordinatorAction) -> Void)?
var callback: (@MainActor(ServerSelectionCoordinatorAction) -> Void)?
// MARK: - Setup
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +26,7 @@ class ServerSelectionViewModel: ServerSelectionViewModelType, ServerSelectionVie
// MARK: Public
var callback: (@MainActor (ServerSelectionViewModelAction) -> Void)?
var callback: (@MainActor(ServerSelectionViewModelAction) -> Void)?
// MARK: - Setup
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +19,7 @@ import Foundation
@MainActor
protocol ServerSelectionViewModelProtocol {
var callback: (@MainActor (ServerSelectionViewModelAction) -> Void)? { get set }
var callback: (@MainActor(ServerSelectionViewModelAction) -> Void)? { get set }
var context: ServerSelectionViewModelType.Context { get }
/// Displays an error to the user.
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");