Skip to content

Commit 6000fd3

Browse files
mluisbrownactions-user
authored andcommitted
Run swift-format
1 parent 8727a0f commit 6000fd3

File tree

13 files changed

+417
-409
lines changed

13 files changed

+417
-409
lines changed

Examples/TicTacToe/Sources/Core/LoginCore.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,47 +52,47 @@ public let loginReducer = Reducer<LoginState, LoginAction, LoginEnvironment>.com
5252
)
5353
}
5454
),
55-
55+
5656
.init {
5757
state, action, environment in
5858
switch action {
5959
case .alertDismissed:
6060
state.alert = nil
6161
return .none
62-
62+
6363
case let .emailChanged(email):
6464
state.email = email
6565
state.isFormValid = !state.email.isEmpty && !state.password.isEmpty
6666
return .none
67-
67+
6868
case let .loginResponse(.success(response)):
6969
state.isLoginRequestInFlight = false
7070
if response.twoFactorRequired {
7171
state.twoFactor = TwoFactorState(token: response.token)
7272
}
7373
return .none
74-
74+
7575
case let .loginResponse(.failure(error)):
7676
state.alert = .init(title: TextState(error.localizedDescription))
7777
state.isLoginRequestInFlight = false
7878
return .none
79-
79+
8080
case let .passwordChanged(password):
8181
state.password = password
8282
state.isFormValid = !state.email.isEmpty && !state.password.isEmpty
8383
return .none
84-
84+
8585
case .loginButtonTapped:
8686
state.isLoginRequestInFlight = true
8787
return environment.authenticationClient
8888
.login(LoginRequest(email: state.email, password: state.password))
8989
.observe(on: environment.mainQueue)
9090
.catchToEffect()
9191
.map(LoginAction.loginResponse)
92-
92+
9393
case .twoFactor:
9494
return .none
95-
95+
9696
case .twoFactorDismissed:
9797
state.twoFactor = nil
9898
return .cancel(id: TwoFactorTearDownToken())

Examples/TicTacToe/Sources/Views-SwiftUI/GameSwiftView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public struct GameView: View {
1515
self.board = state.board.map { $0.map { $0?.label ?? "" } }
1616
self.isGameDisabled = state.board.hasWinner || state.board.isFilled
1717
self.isPlayAgainButtonVisible = state.board.hasWinner || state.board.isFilled
18-
self.title = state.board.hasWinner
18+
self.title =
19+
state.board.hasWinner
1920
? "Winner! Congrats \(state.currentPlayerName)!"
2021
: state.board.isFilled
2122
? "Tied game!"

Examples/TicTacToe/Sources/Views-SwiftUI/LoginSwiftView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public struct LoginView: View {
9898
.padding(.horizontal)
9999
}
100100
}
101-
.navigationBarTitle("Login") }
101+
.navigationBarTitle("Login")
102+
}
102103
}
103104

104105
extension LoginAction {

Examples/TicTacToe/Sources/Views-SwiftUI/NewGameSwiftView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public struct NewGameView: View {
3535
}
3636

3737
public var body: some View {
38-
WithViewStore(self.store.scope(state: ViewState.init, action: NewGameAction.init)) { viewStore in
38+
WithViewStore(self.store.scope(state: ViewState.init, action: NewGameAction.init)) {
39+
viewStore in
3940
ScrollView {
4041
VStack(spacing: 16) {
4142
VStack(alignment: .leading) {

Examples/TicTacToe/Sources/Views-UIKit/GameViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public final class GameViewController: UIViewController {
1717
self.board = state.board.map { $0.map { $0?.label ?? "" } }
1818
self.isGameEnabled = !state.board.hasWinner && !state.board.isFilled
1919
self.isPlayAgainButtonHidden = !state.board.hasWinner && !state.board.isFilled
20-
self.title = state.board.hasWinner
20+
self.title =
21+
state.board.hasWinner
2122
? "Winner! Congrats \(state.currentPlayerName)!"
2223
: state.board.isFilled
2324
? "Tied game!"

Examples/Todos/Todos/Todos.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ struct AppView: View {
128128
self.store.scope(state: \.filteredTodos, action: AppAction.todo(id:action:)),
129129
content: TodoView.init(store:)
130130
)
131-
.onDelete { self.viewStore.send(.delete($0)) }
132-
.onMove { self.viewStore.send(.move($0, $1)) }
131+
.onDelete { self.viewStore.send(.delete($0)) }
132+
.onMove { self.viewStore.send(.move($0, $1)) }
133133
}
134134
}
135135
.navigationBarTitle("Todos")
@@ -143,9 +143,9 @@ struct AppView: View {
143143
Button("Add Todo") { self.viewStore.send(.addTodoButtonTapped, animation: .default) }
144144
}
145145
)
146-
.environment(
147-
\.editMode,
148-
self.viewStore.binding(get: \.editMode, send: AppAction.editModeChanged)
146+
.environment(
147+
\.editMode,
148+
self.viewStore.binding(get: \.editMode, send: AppAction.editModeChanged)
149149
)
150150
}
151151
.navigationViewStyle(StackNavigationViewStyle())

Sources/ComposableArchitecture/Effects/Timer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ extension Effect where Value == Date, Error == Never {
8383
return SignalProducer.timer(
8484
interval: interval, on: scheduler, leeway: tolerance ?? .seconds(.max)
8585
)
86-
.cancellable(id: id, cancelInFlight: true)
86+
.cancellable(id: id, cancelInFlight: true)
8787
}
8888
}

Sources/ComposableArchitecture/Internal/Breakpoint.swift

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
#if canImport(Darwin)
2-
import Darwin
2+
import Darwin
33
#endif
44
/// Raises a debug breakpoint iff a debugger is attached.
55
@inline(__always) func breakpoint() {
66
#if DEBUG && canImport(Darwin)
7-
// https://github.com/bitstadium/HockeySDK-iOS/blob/c6e8d1e940299bec0c0585b1f7b86baf3b17fc82/Classes/BITHockeyHelper.m#L346-L370
8-
var name: [Int32] = [CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()]
9-
var info: kinfo_proc = kinfo_proc()
10-
var info_size = MemoryLayout<kinfo_proc>.size
7+
// https://github.com/bitstadium/HockeySDK-iOS/blob/c6e8d1e940299bec0c0585b1f7b86baf3b17fc82/Classes/BITHockeyHelper.m#L346-L370
8+
var name: [Int32] = [CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()]
9+
var info: kinfo_proc = kinfo_proc()
10+
var info_size = MemoryLayout<kinfo_proc>.size
1111

12-
let isDebuggerAttached = name.withUnsafeMutableBytes {
13-
$0.bindMemory(to: Int32.self).baseAddress
14-
.map { sysctl($0, 4, &info, &info_size, nil, 0) != -1 && info.kp_proc.p_flag & P_TRACED != 0 }
15-
?? false
16-
}
12+
let isDebuggerAttached = name.withUnsafeMutableBytes {
13+
$0.bindMemory(to: Int32.self).baseAddress
14+
.map {
15+
sysctl($0, 4, &info, &info_size, nil, 0) != -1 && info.kp_proc.p_flag & P_TRACED != 0
16+
}
17+
?? false
18+
}
1719

18-
if isDebuggerAttached {
19-
fputs(
20-
"""
21-
Caught debug breakpoint. Type "continue" ("c") to resume execution.
20+
if isDebuggerAttached {
21+
fputs(
22+
"""
23+
Caught debug breakpoint. Type "continue" ("c") to resume execution.
2224
23-
""",
24-
stderr
25-
)
26-
raise(SIGTRAP)
27-
}
25+
""",
26+
stderr
27+
)
28+
raise(SIGTRAP)
29+
}
2830
#endif
2931
}
30-

Sources/ComposableArchitecture/Store.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ public final class Store<State, Action> {
221221
)
222222
localStore.parentDisposable = self.$state.producer.startWithValues {
223223
[weak localStore] state in
224-
guard let localStore = localStore else { return }
224+
guard let localStore = localStore else { return }
225225
localStore.state = extractLocalState(state) ?? localStore.state
226-
}
226+
}
227227
return localStore
228228
}
229229
}
@@ -344,7 +344,7 @@ public struct Produced<Value>: SignalProducerConvertible {
344344
dynamicMember keyPath: KeyPath<Value, LocalValue>
345345
) -> Produced<LocalValue> where LocalValue: Equatable {
346346
Produced<LocalValue>(by: self.producer.map(keyPath).skipRepeats())
347-
}
347+
}
348348
}
349349

350350
@available(

0 commit comments

Comments
 (0)