Skip to content

Commit 36434e7

Browse files
committed
Format.
1 parent 9d54d4e commit 36434e7

File tree

13 files changed

+50
-41
lines changed

13 files changed

+50
-41
lines changed

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
- uses: stefanzweifel/git-auto-commit-action@v4
1919
with:
2020
commit_message: Run swift-format
21-
branch: 'main'
21+
branch: 'master'
2222
env:
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Examples/CaseStudies/SwiftUICaseStudies/00-Core.swift

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import ReactiveSwift
21
import ComposableArchitecture
2+
import ReactiveSwift
33
import UIKit
44

55
struct RootState {
@@ -253,26 +253,30 @@ let rootReducer = Reducer<RootState, RootAction, RootEnvironment>.combine(
253253
// Typically this live implementation of the dependency would live in its own module so that the
254254
// main feature doesn't need to compile it.
255255
func liveNumberFact(for n: Int) -> Effect<String, NumbersApiError> {
256-
URLSession.shared.reactive.data(with: URLRequest(url: URL(string: "http://numbersapi.com/\(n)/trivia")!))
257-
.map { data, _ in String(decoding: data, as: UTF8.self) }
258-
.flatMapError { _ in
259-
Effect(value: "\(n) is a good number Brent")
260-
.delay(1, on: QueueScheduler.main)
261-
}
262-
.promoteError(NumbersApiError.self)
256+
URLSession.shared.reactive.data(
257+
with: URLRequest(url: URL(string: "http://numbersapi.com/\(n)/trivia")!)
258+
)
259+
.map { data, _ in String(decoding: data, as: UTF8.self) }
260+
.flatMapError { _ in
261+
Effect(value: "\(n) is a good number Brent")
262+
.delay(1, on: QueueScheduler.main)
263+
}
264+
.promoteError(NumbersApiError.self)
263265
}
264266

265267
// This is the "live" trivia dependency that reaches into the outside world to fetch trivia.
266268
// Typically this live implementation of the dependency would live in its own module so that the
267269
// main feature doesn't need to compile it.
268270
func liveTrivia(for n: Int) -> Effect<String, TriviaApiError> {
269-
URLSession.shared.reactive.data(with: URLRequest(url: URL(string: "http://numbersapi.com/\(n)/trivia")!))
270-
.map { data, _ in String.init(decoding: data, as: UTF8.self) }
271-
.flatMapError { _ in
272-
Effect(value: "\(n) is a good number Brent")
273-
.delay(1, on: QueueScheduler.main)
274-
}
275-
.promoteError(TriviaApiError.self)
271+
URLSession.shared.reactive.data(
272+
with: URLRequest(url: URL(string: "http://numbersapi.com/\(n)/trivia")!)
273+
)
274+
.map { data, _ in String.init(decoding: data, as: UTF8.self) }
275+
.flatMapError { _ in
276+
Effect(value: "\(n) is a good number Brent")
277+
.delay(1, on: QueueScheduler.main)
278+
}
279+
.promoteError(TriviaApiError.self)
276280
}
277281

278282
private func liveFetchNumber() -> Effect<Int, Never> {
@@ -283,4 +287,3 @@ private func liveFetchNumber() -> Effect<Int, Never> {
283287
private let liveUserDidTakeScreenshot = NotificationCenter.default
284288
.reactive.notifications(forName: UIApplication.userDidTakeScreenshotNotification)
285289
.map { _ in () }
286-

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let animationsReducer = Reducer<AnimationsState, AnimationsAction, AnimationsEnv
5151
? Effect(value: .setColor(color))
5252
: Effect(value: .setColor(color))
5353
.delay(1, on: environment.mainQueue)
54-
}
54+
}
5555
)
5656

5757
case let .setColor(color):
@@ -105,7 +105,7 @@ struct AnimationsView: View {
105105
)
106106
.padding()
107107
Button("Rainbow") { viewStore.send(.rainbowButtonTapped) }
108-
.padding([.leading, .trailing, .bottom])
108+
.padding([.leading, .trailing, .bottom])
109109
}
110110
}
111111
}
@@ -121,7 +121,7 @@ struct AnimationsView_Previews: PreviewProvider {
121121
initialState: AnimationsState(circleCenter: CGPoint(x: 50, y: 50)),
122122
reducer: animationsReducer,
123123
environment: AnimationsEnvironment(
124-
mainQueue: QueueScheduler.main
124+
mainQueue: QueueScheduler.main
125125
)
126126
)
127127
)

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-WebSocket.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import ReactiveSwift
21
import ComposableArchitecture
2+
import ReactiveSwift
33
import SwiftUI
44

55
private let readMe = """
@@ -148,9 +148,11 @@ struct WebSocketView: View {
148148
)
149149

150150
Button(
151-
viewStore.connectivityState == .connected ? "Disconnect"
152-
: viewStore.connectivityState == .disconnected ? "Connect"
153-
: "Connecting..."
151+
viewStore.connectivityState == .connected
152+
? "Disconnect"
153+
: viewStore.connectivityState == .disconnected
154+
? "Connect"
155+
: "Connecting..."
154156
) {
155157
viewStore.send(.connectButtonTapped)
156158
}

Examples/CaseStudies/SwiftUICaseStudiesTests/01-GettingStarted-AnimationsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import ReactiveSwift
21
import ComposableArchitecture
2+
import ReactiveSwift
33
import XCTest
44

55
@testable import SwiftUICaseStudies

Examples/CaseStudies/SwiftUICaseStudiesTests/02-Effects-WebSocketTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import ReactiveSwift
21
import ComposableArchitecture
2+
import ReactiveSwift
33
import XCTest
44

55
@testable import SwiftUICaseStudies

Examples/MotionManager/MotionManager/MotionManagerView.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ let appReducer = Reducer<AppState, AppAction, AppEnvironment> { state, action, e
5050
return .none
5151

5252
case .motionUpdate(.failure):
53-
state.alert = .init(title: """
54-
We encountered a problem with the motion manager. Make sure you run this demo on a real \
55-
device, not the simulator.
56-
""")
53+
state.alert = .init(
54+
title: """
55+
We encountered a problem with the motion manager. Make sure you run this demo on a real \
56+
device, not the simulator.
57+
""")
5758
state.isRecording = false
5859
return .none
5960

Examples/MotionManager/MotionManagerTests/MotionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import ReactiveSwift
21
import ComposableArchitecture
32
import ComposableCoreMotion
43
import CoreMotion
4+
import ReactiveSwift
55
import XCTest
66

77
@testable import MotionManagerDemo

Examples/SpeechRecognition/SpeechRecognition/SpeechRecognition.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ let appReducer = Reducer<AppState, AppAction, AppEnvironment> { state, action, e
7979
return .none
8080

8181
case .denied:
82-
state.alert = .init(title: """
83-
You denied access to speech recognition. This app needs access to transcribe your speech.
84-
""")
82+
state.alert = .init(
83+
title: """
84+
You denied access to speech recognition. This app needs access to transcribe your speech.
85+
""")
8586
return .none
8687

8788
case .restricted:

Examples/SpeechRecognition/SpeechRecognitionTests/SpeechRecognitionTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class SpeechRecognitionTests: XCTestCase {
2828
.receive(.speechRecognizerAuthorizationStatusResponse(.denied)) {
2929
$0.alert = .init(
3030
title: """
31-
You denied access to speech recognition. This app needs access to transcribe your speech.
32-
"""
31+
You denied access to speech recognition. This app needs access to transcribe your speech.
32+
"""
3333
)
3434
$0.isRecording = false
3535
$0.speechRecognizerAuthorizationStatus = .denied

0 commit comments

Comments
 (0)