Skip to content

Commit b1219a1

Browse files
mluisbrownactions-user
authored andcommitted
Run swift-format
1 parent 6415e3d commit b1219a1

File tree

10 files changed

+53
-45
lines changed

10 files changed

+53
-45
lines changed

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ class SharedStateTests: XCTestCase {
1111
reducer: sharedStateReducer,
1212
environment: ()
1313
)
14-
14+
1515
store.assert(
1616
.send(.selectTab(.profile)) {
1717
$0.currentTab = .profile
18-
$0.profile = .init(currentTab: .profile, count: 0, maxCount: 0, minCount: 0, numberOfCounts: 0)
18+
$0.profile = .init(
19+
currentTab: .profile, count: 0, maxCount: 0, minCount: 0, numberOfCounts: 0)
1920
},
2021
.send(.profile(.resetCounterButtonTapped)) {
2122
$0.currentTab = .counter
22-
$0.profile = .init(currentTab: .counter, count: 0, maxCount: 0, minCount: 0, numberOfCounts: 0)
23+
$0.profile = .init(
24+
currentTab: .counter, count: 0, maxCount: 0, minCount: 0, numberOfCounts: 0)
2325
})
2426
}
2527

@@ -33,11 +35,13 @@ class SharedStateTests: XCTestCase {
3335
store.assert(
3436
.send(.selectTab(.profile)) {
3537
$0.currentTab = .profile
36-
$0.profile = .init(currentTab: .profile, count: 0, maxCount: 0, minCount: 0, numberOfCounts: 0)
38+
$0.profile = .init(
39+
currentTab: .profile, count: 0, maxCount: 0, minCount: 0, numberOfCounts: 0)
3740
},
3841
.send(.selectTab(.counter)) {
3942
$0.currentTab = .counter
40-
$0.profile = .init(currentTab: .counter, count: 0, maxCount: 0, minCount: 0, numberOfCounts: 0)
43+
$0.profile = .init(
44+
currentTab: .counter, count: 0, maxCount: 0, minCount: 0, numberOfCounts: 0)
4145
})
4246
}
4347

@@ -67,7 +71,8 @@ class SharedStateTests: XCTestCase {
6771

6872
func testIsPrimeWhenPrime() {
6973
let store = TestStore(
70-
initialState: SharedState.CounterState(alert: nil, count: 3, maxCount: 0, minCount: 0, numberOfCounts: 0),
74+
initialState: SharedState.CounterState(
75+
alert: nil, count: 3, maxCount: 0, minCount: 0, numberOfCounts: 0),
7176
reducer: sharedStateCounterReducer,
7277
environment: ()
7378
)
@@ -86,7 +91,8 @@ class SharedStateTests: XCTestCase {
8691

8792
func testIsPrimeWhenNotPrime() {
8893
let store = TestStore(
89-
initialState: SharedState.CounterState(alert: nil, count: 6, maxCount: 0, minCount: 0, numberOfCounts: 0),
94+
initialState: SharedState.CounterState(
95+
alert: nil, count: 6, maxCount: 0, minCount: 0, numberOfCounts: 0),
9096
reducer: sharedStateCounterReducer,
9197
environment: ()
9298
)

Examples/VoiceMemos/VoiceMemos/VoiceMemo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ let voiceMemoReducer = Reducer<VoiceMemo, VoiceMemoAction, VoiceMemoEnvironment>
7070
date.timeIntervalSinceReferenceDate - start.timeIntervalSinceReferenceDate
7171
)
7272
},
73-
73+
7474
environment.audioPlayerClient
7575
.play(PlayerId(), memo.url)
7676
.catchToEffect()

Sources/ComposableArchitecture/Internal/LocalizedStringKey.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ extension LocalizedStringKey: CustomDebugOutputConvertible {
1313
let formatter: Formatter?
1414
// `LocalizedStringKey.FormatArgument` differs depending on OS/platform.
1515
if children[0].label == "storage" {
16-
(value, formatter) = Array(Mirror(reflecting: children[0].value).children)[0].value as! (Any, Formatter?)
16+
(value, formatter) =
17+
Array(Mirror(reflecting: children[0].value).children)[0].value as! (Any, Formatter?)
1718
} else {
1819
value = children[0].value
1920
formatter = children[1].value as? Formatter

Sources/ComposableArchitecture/Store.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ public final class Store<State, Action> {
140140
}
141141

142142
while !self.synchronousActionsToSend.isEmpty || !self.bufferedActions.isEmpty {
143-
let action = !self.synchronousActionsToSend.isEmpty
143+
let action =
144+
!self.synchronousActionsToSend.isEmpty
144145
? self.synchronousActionsToSend.removeFirst()
145146
: self.bufferedActions.removeFirst()
146147

Sources/ComposableArchitecture/SwiftUI/IdentifiedArray.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ where ID: Hashable {
191191
try areInIncreasingOrder(self.dictionary[$0]!, self.dictionary[$1]!)
192192
}
193193
}
194-
195-
public mutating func shuffle<T>(using generator: inout T) where T : RandomNumberGenerator {
194+
195+
public mutating func shuffle<T>(using generator: inout T) where T: RandomNumberGenerator {
196196
ids.shuffle(using: &generator)
197197
}
198-
198+
199199
public mutating func shuffle() {
200200
var rng = SystemRandomNumberGenerator()
201201
self.shuffle(using: &rng)

Sources/ComposableArchitecture/TestSupport/TestStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
effects.on(
244244
starting: { longLivingEffects[key, default: []].insert(id) },
245245
completed: { longLivingEffects[key]?.remove(id) },
246-
// terminated: { longLivingEffects[key]?.remove(id) },
246+
// terminated: { longLivingEffects[key]?.remove(id) },
247247
disposed: { longLivingEffects[key]?.remove(id) }
248248
)
249249
.map(TestAction.receive)

Sources/ComposableCoreLocation/Models/Location.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ extension Location: Hashable {
8080
hasher.combine(self.verticalAccuracy)
8181

8282
#if compiler(>=5.2)
83-
if #available(iOS 13.4, macCatalyst 13.4, macOS 10.15.4, tvOS 13.4, watchOS 6.2, *) {
84-
hasher.combine(self.floor)
85-
hasher.combine(self.speedAccuracy)
86-
hasher.combine(self.courseAccuracy)
87-
}
83+
if #available(iOS 13.4, macCatalyst 13.4, macOS 10.15.4, tvOS 13.4, watchOS 6.2, *) {
84+
hasher.combine(self.floor)
85+
hasher.combine(self.speedAccuracy)
86+
hasher.combine(self.courseAccuracy)
87+
}
8888
#endif
8989
}
9090
}

Tests/ComposableArchitectureTests/IdentifiedArrayTests.swift

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -196,37 +196,37 @@ final class IdentifiedArrayTests: XCTestCase {
196196
], array)
197197

198198
}
199-
199+
200200
// Account for randomness API changes in Swift 5.3 (https://twitter.com/mbrandonw/status/1262388756847505410)
201201
// TODO: Try swapping out the LCRNG for a Xoshiro generator
202202
#if swift(>=5.3)
203-
func testShuffle() {
204-
struct User: Equatable, Identifiable {
205-
let id: Int
206-
var name: String
207-
}
203+
func testShuffle() {
204+
struct User: Equatable, Identifiable {
205+
let id: Int
206+
var name: String
207+
}
208208

209-
var array: IdentifiedArray = [
210-
User(id: 1, name: "Blob"),
211-
User(id: 2, name: "Blob Jr."),
212-
User(id: 3, name: "Blob Sr."),
213-
User(id: 4, name: "Foo Jr."),
214-
User(id: 5, name: "Bar Jr."),
215-
]
216-
var lcrng = LCRNG(seed: 0)
217-
array.shuffle(using: &lcrng)
218-
XCTAssertEqual(
219-
[
209+
var array: IdentifiedArray = [
220210
User(id: 1, name: "Blob"),
211+
User(id: 2, name: "Blob Jr."),
221212
User(id: 3, name: "Blob Sr."),
222-
User(id: 5, name: "Bar Jr."),
223213
User(id: 4, name: "Foo Jr."),
224-
User(id: 2, name: "Blob Jr.")
225-
],
226-
array.elements
227-
)
228-
XCTAssertEqual([1, 3, 5, 4, 2], array.ids)
229-
}
214+
User(id: 5, name: "Bar Jr."),
215+
]
216+
var lcrng = LCRNG(seed: 0)
217+
array.shuffle(using: &lcrng)
218+
XCTAssertEqual(
219+
[
220+
User(id: 1, name: "Blob"),
221+
User(id: 3, name: "Blob Sr."),
222+
User(id: 5, name: "Bar Jr."),
223+
User(id: 4, name: "Foo Jr."),
224+
User(id: 2, name: "Blob Jr."),
225+
],
226+
array.elements
227+
)
228+
XCTAssertEqual([1, 3, 5, 4, 2], array.ids)
229+
}
230230
#endif
231231

232232
func testReverse() {

Tests/ComposableArchitectureTests/LCRNG.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public struct LCRNG: RandomNumberGenerator {
99

1010
@inlinable
1111
public mutating func next() -> UInt64 {
12-
seed = 2862933555777941757 &* seed &+ 3037000493
12+
seed = 2_862_933_555_777_941_757 &* seed &+ 3_037_000_493
1313
return seed
1414
}
1515
}

Tests/ComposableArchitectureTests/TestStoreTests.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
class TestStoreTests: XCTestCase {

0 commit comments

Comments
 (0)