Skip to content

Commit f02d8f6

Browse files
stephencelisgithub-actions[bot]
authored andcommitted
Run swift-format
1 parent 051e5bd commit f02d8f6

22 files changed

+83
-91
lines changed

Examples/CaseStudies/SwiftUICaseStudiesTests/05-HigherOrderReducers-RecursionTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class RecursionTests: XCTestCase {
1515
$0.rows.append(Nested.State(id: UUID(0)))
1616
}
1717

18-
await store.send(\.rows[id: UUID(0)].addRowButtonTapped) {
18+
await store.send(\.rows[id:UUID(0)].addRowButtonTapped) {
1919
$0.rows[id: UUID(0)]?.rows.append(Nested.State(id: UUID(1)))
2020
}
2121
}

Examples/CaseStudies/SwiftUICaseStudiesTests/05-HigherOrderReducers-ReusableFavoritingTests.swift

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ final class ReusableComponentsFavoritingTests: XCTestCase {
3333
)
3434
}
3535

36-
await store.send(\.episodes[id: UUID(0)].favorite.buttonTapped) {
36+
await store.send(\.episodes[id:UUID(0)].favorite.buttonTapped) {
3737
$0.episodes[id: UUID(0)]?.isFavorite = true
3838
}
3939
await clock.advance(by: .seconds(1))
40-
await store.receive(\.episodes[id: episodes[0].id].favorite.response.success)
40+
await store.receive(\.episodes[id:episodes[0].id].favorite.response.success)
4141

42-
await store.send(\.episodes[id: episodes[1].id].favorite.buttonTapped) {
42+
await store.send(\.episodes[id:episodes[1].id].favorite.buttonTapped) {
4343
$0.episodes[id: UUID(1)]?.isFavorite = true
4444
}
45-
await store.send(\.episodes[id: episodes[1].id].favorite.buttonTapped) {
45+
await store.send(\.episodes[id:episodes[1].id].favorite.buttonTapped) {
4646
$0.episodes[id: UUID(1)]?.isFavorite = false
4747
}
4848
await clock.advance(by: .seconds(1))
49-
await store.receive(\.episodes[id: episodes[1].id].favorite.response.success)
49+
await store.receive(\.episodes[id:episodes[1].id].favorite.response.success)
5050
}
5151

5252
func testUnhappyPath() async {
@@ -61,17 +61,17 @@ final class ReusableComponentsFavoritingTests: XCTestCase {
6161
Episodes(favorite: { _, _ in throw FavoriteError() })
6262
}
6363

64-
await store.send(\.episodes[id: UUID(0)].favorite.buttonTapped) {
64+
await store.send(\.episodes[id:UUID(0)].favorite.buttonTapped) {
6565
$0.episodes[id: UUID(0)]?.isFavorite = true
6666
}
6767

68-
await store.receive(\.episodes[id: episodes[0].id].favorite.response.failure) {
68+
await store.receive(\.episodes[id:episodes[0].id].favorite.response.failure) {
6969
$0.episodes[id: UUID(0)]?.alert = AlertState {
7070
TextState("Favoriting failed.")
7171
}
7272
}
7373

74-
await store.send(\.episodes[id: UUID(0)].favorite.alert.dismiss) {
74+
await store.send(\.episodes[id:UUID(0)].favorite.alert.dismiss) {
7575
$0.episodes[id: UUID(0)]?.alert = nil
7676
$0.episodes[id: UUID(0)]?.isFavorite = false
7777
}

Examples/CaseStudies/UIKitCaseStudies/ListsOfState.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ final class CountersTableViewController: UITableViewController {
6363

6464
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
6565
let id = store.counters[indexPath.row].id
66-
if let store = store.scope(state: \.counters[id: id], action: \.counters[id: id]) {
66+
if let store = store.scope(state: \.counters[id:id], action: \.counters[id:id]) {
6767
navigationController?.pushViewController(CounterViewController(store: store), animated: true)
6868
}
6969
}

Examples/CaseStudies/UIKitCaseStudiesTests/UIKitCaseStudiesTests.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ final class UIKitCaseStudiesTests: XCTestCase {
3030
CounterList()
3131
}
3232

33-
await store.send(\.counters[id: firstState.id].incrementButtonTapped) {
33+
await store.send(\.counters[id:firstState.id].incrementButtonTapped) {
3434
$0.counters[id: firstState.id]?.count = 1
3535
}
36-
await store.send(\.counters[id: firstState.id].decrementButtonTapped) {
36+
await store.send(\.counters[id:firstState.id].decrementButtonTapped) {
3737
$0.counters[id: firstState.id]?.count = 0
3838
}
3939

40-
await store.send(\.counters[id: secondState.id].incrementButtonTapped) {
40+
await store.send(\.counters[id:secondState.id].incrementButtonTapped) {
4141
$0.counters[id: secondState.id]?.count = 1
4242
}
43-
await store.send(\.counters[id: secondState.id].decrementButtonTapped) {
43+
await store.send(\.counters[id:secondState.id].decrementButtonTapped) {
4444
$0.counters[id: secondState.id]?.count = 0
4545
}
4646

47-
await store.send(\.counters[id: thirdState.id].incrementButtonTapped) {
47+
await store.send(\.counters[id:thirdState.id].incrementButtonTapped) {
4848
$0.counters[id: thirdState.id]?.count = 1
4949
}
50-
await store.send(\.counters[id: thirdState.id].decrementButtonTapped) {
50+
await store.send(\.counters[id:thirdState.id].decrementButtonTapped) {
5151
$0.counters[id: thirdState.id]?.count = 0
5252
}
5353
}

Examples/SyncUps/SyncUpsTests/AppFeatureTests.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ final class AppFeatureTests: XCTestCase {
1717
$0.path[id: 0] = .detail(SyncUpDetail.State(syncUp: sharedSyncUp))
1818
}
1919

20-
await store.send(\.path[id: 0].detail.editButtonTapped) {
20+
await store.send(\.path[id:0].detail.editButtonTapped) {
2121
$0.path[id: 0]?.modify(\.detail) { $0.destination = .edit(SyncUpForm.State(syncUp: syncUp)) }
2222
}
2323

2424
syncUp.title = "Blob"
25-
await store.send(\.path[id: 0].detail.destination.edit.binding.syncUp, syncUp) {
25+
await store.send(\.path[id:0].detail.destination.edit.binding.syncUp, syncUp) {
2626
$0.path[id: 0]?.modify(\.detail) {
2727
$0.destination?.modify(\.edit) { $0.syncUp.title = "Blob" }
2828
}
2929
}
3030

31-
await store.send(\.path[id: 0].detail.doneEditingButtonTapped) {
31+
await store.send(\.path[id:0].detail.doneEditingButtonTapped) {
3232
$0.path[id: 0]?.modify(\.detail) {
3333
$0.destination = nil
3434
$0.syncUp.title = "Blob"
@@ -50,11 +50,11 @@ final class AppFeatureTests: XCTestCase {
5050
$0.path[id: 0] = .detail(SyncUpDetail.State(syncUp: sharedSyncUp))
5151
}
5252

53-
await store.send(\.path[id: 0].detail.deleteButtonTapped) {
53+
await store.send(\.path[id:0].detail.deleteButtonTapped) {
5454
$0.path[id: 0]?.modify(\.detail) { $0.destination = .alert(.deleteSyncUp) }
5555
}
5656

57-
await store.send(\.path[id: 0].detail.destination.alert.confirmDeletion) {
57+
await store.send(\.path[id:0].detail.destination.alert.confirmDeletion) {
5858
$0.path[id: 0]?.modify(\.detail) { $0.destination = nil }
5959
$0.syncUpsList.syncUps = []
6060
}
@@ -104,7 +104,7 @@ final class AppFeatureTests: XCTestCase {
104104
}
105105

106106
await store.withExhaustivity(.off) {
107-
await store.send(\.path[id: 1].record.onTask)
107+
await store.send(\.path[id:1].record.onTask)
108108
await store.receive(\.path.popFrom) {
109109
XCTAssertEqual($0.path.count, 1)
110110
}

Examples/Todos/TodosTests/TodosTests.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ final class TodosTests: XCTestCase {
5555
Todos()
5656
}
5757

58-
await store.send(\.todos[id: UUID(0)].binding.description, "Learn Composable Architecture") {
58+
await store.send(\.todos[id:UUID(0)].binding.description, "Learn Composable Architecture") {
5959
$0.todos[id: UUID(0)]?.description = "Learn Composable Architecture"
6060
}
6161
}
@@ -82,7 +82,7 @@ final class TodosTests: XCTestCase {
8282
$0.continuousClock = clock
8383
}
8484

85-
await store.send(\.todos[id: UUID(0)].binding.isComplete, true) {
85+
await store.send(\.todos[id:UUID(0)].binding.isComplete, true) {
8686
$0.todos[id: UUID(0)]?.isComplete = true
8787
}
8888
await clock.advance(by: .seconds(1))
@@ -116,11 +116,11 @@ final class TodosTests: XCTestCase {
116116
$0.continuousClock = clock
117117
}
118118

119-
await store.send(\.todos[id: UUID(0)].binding.isComplete, true) {
119+
await store.send(\.todos[id:UUID(0)].binding.isComplete, true) {
120120
$0.todos[id: UUID(0)]?.isComplete = true
121121
}
122122
await clock.advance(by: .milliseconds(500))
123-
await store.send(\.todos[id: UUID(0)].binding.isComplete, false) {
123+
await store.send(\.todos[id:UUID(0)].binding.isComplete, false) {
124124
$0.todos[id: UUID(0)]?.isComplete = false
125125
}
126126
await clock.advance(by: .seconds(1))
@@ -336,7 +336,7 @@ final class TodosTests: XCTestCase {
336336
await store.send(\.binding.filter, .completed) {
337337
$0.filter = .completed
338338
}
339-
await store.send(\.todos[id: UUID(1)].binding.description, "Did this already") {
339+
await store.send(\.todos[id:UUID(1)].binding.description, "Did this already") {
340340
$0.todos[id: UUID(1)]?.description = "Did this already"
341341
}
342342
}

Examples/VoiceMemos/VoiceMemosTests/VoiceMemosTests.swift

+19-19
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,25 @@ final class VoiceMemosTests: XCTestCase {
6161
)
6262
]
6363
}
64-
await store.send(\.voiceMemos[id: deadbeefURL].playButtonTapped) {
64+
await store.send(\.voiceMemos[id:deadbeefURL].playButtonTapped) {
6565
$0.voiceMemos[id: deadbeefURL]?.mode = .playing(progress: 0)
6666
}
67-
await store.receive(\.voiceMemos[id: deadbeefURL].delegate.playbackStarted)
67+
await store.receive(\.voiceMemos[id:deadbeefURL].delegate.playbackStarted)
6868
await clock.run()
6969

70-
await store.receive(\.voiceMemos[id: deadbeefURL].timerUpdated) {
70+
await store.receive(\.voiceMemos[id:deadbeefURL].timerUpdated) {
7171
$0.voiceMemos[id: deadbeefURL]?.mode = .playing(progress: 0.2)
7272
}
73-
await store.receive(\.voiceMemos[id: deadbeefURL].timerUpdated) {
73+
await store.receive(\.voiceMemos[id:deadbeefURL].timerUpdated) {
7474
$0.voiceMemos[id: deadbeefURL]?.mode = .playing(progress: 0.4)
7575
}
76-
await store.receive(\.voiceMemos[id: deadbeefURL].timerUpdated) {
76+
await store.receive(\.voiceMemos[id:deadbeefURL].timerUpdated) {
7777
$0.voiceMemos[id: deadbeefURL]?.mode = .playing(progress: 0.6)
7878
}
79-
await store.receive(\.voiceMemos[id: deadbeefURL].timerUpdated) {
79+
await store.receive(\.voiceMemos[id:deadbeefURL].timerUpdated) {
8080
$0.voiceMemos[id: deadbeefURL]?.mode = .playing(progress: 0.8)
8181
}
82-
await store.receive(\.voiceMemos[id: deadbeefURL].audioPlayerClient.success) {
82+
await store.receive(\.voiceMemos[id:deadbeefURL].audioPlayerClient.success) {
8383
$0.voiceMemos[id: deadbeefURL]?.mode = .notPlaying
8484
}
8585
}
@@ -260,20 +260,20 @@ final class VoiceMemosTests: XCTestCase {
260260
$0.continuousClock = clock
261261
}
262262

263-
await store.send(\.voiceMemos[id: url].playButtonTapped) {
263+
await store.send(\.voiceMemos[id:url].playButtonTapped) {
264264
$0.voiceMemos[id: url]?.mode = .playing(progress: 0)
265265
}
266-
await store.receive(\.voiceMemos[id: url].delegate.playbackStarted)
266+
await store.receive(\.voiceMemos[id:url].delegate.playbackStarted)
267267
await clock.advance(by: .milliseconds(500))
268-
await store.receive(\.voiceMemos[id: url].timerUpdated) {
268+
await store.receive(\.voiceMemos[id:url].timerUpdated) {
269269
$0.voiceMemos[id: url]?.mode = .playing(progress: 0.4)
270270
}
271271
await clock.advance(by: .milliseconds(500))
272-
await store.receive(\.voiceMemos[id: url].timerUpdated) {
272+
await store.receive(\.voiceMemos[id:url].timerUpdated) {
273273
$0.voiceMemos[id: url]?.mode = .playing(progress: 0.8)
274274
}
275275
await clock.advance(by: .milliseconds(250))
276-
await store.receive(\.voiceMemos[id: url].audioPlayerClient.success) {
276+
await store.receive(\.voiceMemos[id:url].audioPlayerClient.success) {
277277
$0.voiceMemos[id: url]?.mode = .notPlaying
278278
}
279279
}
@@ -302,14 +302,14 @@ final class VoiceMemosTests: XCTestCase {
302302
$0.continuousClock = clock
303303
}
304304

305-
let task = await store.send(\.voiceMemos[id: url].playButtonTapped) {
305+
let task = await store.send(\.voiceMemos[id:url].playButtonTapped) {
306306
$0.voiceMemos[id: url]?.mode = .playing(progress: 0)
307307
}
308-
await store.receive(\.voiceMemos[id: url].delegate.playbackStarted)
309-
await store.receive(\.voiceMemos[id: url].audioPlayerClient.failure) {
308+
await store.receive(\.voiceMemos[id:url].delegate.playbackStarted)
309+
await store.receive(\.voiceMemos[id:url].audioPlayerClient.failure) {
310310
$0.voiceMemos[id: url]?.mode = .notPlaying
311311
}
312-
await store.receive(\.voiceMemos[id: url].delegate.playbackFailed) {
312+
await store.receive(\.voiceMemos[id:url].delegate.playbackFailed) {
313313
$0.alert = AlertState { TextState("Voice memo playback failed.") }
314314
}
315315
await task.cancel()
@@ -333,7 +333,7 @@ final class VoiceMemosTests: XCTestCase {
333333
VoiceMemos()
334334
}
335335

336-
await store.send(\.voiceMemos[id: url].playButtonTapped) {
336+
await store.send(\.voiceMemos[id:url].playButtonTapped) {
337337
$0.voiceMemos[id: url]?.mode = .notPlaying
338338
}
339339
}
@@ -435,10 +435,10 @@ final class VoiceMemosTests: XCTestCase {
435435
$0.continuousClock = clock
436436
}
437437

438-
await store.send(\.voiceMemos[id: url].playButtonTapped) {
438+
await store.send(\.voiceMemos[id:url].playButtonTapped) {
439439
$0.voiceMemos[id: url]?.mode = .playing(progress: 0)
440440
}
441-
await store.receive(\.voiceMemos[id: url].delegate.playbackStarted)
441+
await store.receive(\.voiceMemos[id:url].delegate.playbackStarted)
442442
await store.send(.onDelete([0])) {
443443
$0.voiceMemos = []
444444
}

Sources/ComposableArchitecture/Internal/EphemeralState.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/// with they are dismissed. Such features do not manage any behavior on the inside.
55
///
66
/// Alerts and confirmation dialogs are examples of this kind of state.
7-
@_documentation(visibility: public)
7+
@_documentation(visibility:public)
88
public protocol _EphemeralState<Action> {
99
associatedtype Action
1010
static var actionType: Any.Type { get }
@@ -14,10 +14,10 @@ extension _EphemeralState {
1414
public static var actionType: Any.Type { Action.self }
1515
}
1616

17-
@_documentation(visibility: private)
17+
@_documentation(visibility:private)
1818
extension AlertState: _EphemeralState {}
1919

20-
@_documentation(visibility: private)
20+
@_documentation(visibility:private)
2121
@available(iOS 13, macOS 12, tvOS 13, watchOS 6, *)
2222
extension ConfirmationDialogState: _EphemeralState {}
2323

Sources/ComposableArchitecture/Internal/RuntimeWarnings.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22
import IssueReporting
33

44
extension Notification.Name {
5-
@_documentation(visibility: private)
5+
@_documentation(visibility:private)
66
@available(*, deprecated, renamed: "_runtimeWarning")
77
public static let runtimeWarning = Self("ComposableArchitecture.runtimeWarning")
88

Sources/ComposableArchitecture/Macros.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public macro Reducer(state: _SynthesizedConformance..., action: _SynthesizedConf
4747
/// the ``Reducer()`` macro.
4848
///
4949
/// See <doc:Reducers#Synthesizing-protocol-conformances-on-State-and-Action> for more information.
50-
@_documentation(visibility: public)
50+
@_documentation(visibility:public)
5151
public struct _SynthesizedConformance: Sendable {}
5252

5353
extension _SynthesizedConformance {

Sources/ComposableArchitecture/Observation/IdentifiedArray+Observation.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
let id = self.data.ids[position]
106106
var element = self.data[position]
107107
return self.store.scope(
108-
id: self.store.id(state: \.[id: id]!, action: \.[id: id]),
108+
id: self.store.id(state: \.[id:id]!, action: \.[id:id]),
109109
state: ToState {
110110
element = $0[id: id] ?? element
111111
return element

Sources/ComposableArchitecture/Observation/NavigationStack+Observation.swift

+4-6
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,11 @@ import SwiftUI
195195
id: self.store.id(
196196
state:
197197
\.[
198-
id: component.id,
199-
fileID: _HashableStaticString(
200-
rawValue: fileID),
201-
filePath: _HashableStaticString(
202-
rawValue: filePath), line: line, column: column
198+
id:component.id,fileID:_HashableStaticString(
199+
rawValue: fileID),filePath:_HashableStaticString(
200+
rawValue: filePath),line:line,column:column
203201
],
204-
action: \.[id: component.id]
202+
action: \.[id:component.id]
205203
),
206204
state: ToState {
207205
element = $0[id: component.id] ?? element

Sources/ComposableArchitecture/Reducer/Reducers/DebugReducer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extension Reducer {
1111
/// - Returns: A reducer that prints debug messages for all received actions.
1212
@inlinable
1313
@warn_unqualified_access
14-
@_documentation(visibility: public)
14+
@_documentation(visibility:public)
1515
public func _printChanges(
1616
_ printer: _ReducerPrinter<State, Action>? = .customDump
1717
) -> _PrintChangesReducer<Self> {

Sources/ComposableArchitecture/SharedState/Shared.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public struct Shared<Value> {
6262
else { return nil }
6363
self.init(
6464
reference: base.reference,
65-
keyPath: base.keyPath.appending(path: \Value?.[default: DefaultSubscript(initialValue)])!
65+
keyPath: base.keyPath.appending(path: \Value?.[default:DefaultSubscript(initialValue)])!
6666
)
6767
}
6868

Sources/ComposableArchitecture/SharedState/SharedReader.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public struct SharedReader<Value> {
4747
else { return nil }
4848
self.init(
4949
reference: base.reference,
50-
keyPath: base.keyPath.appending(path: \Value?.[default: DefaultSubscript(initialValue)])!
50+
keyPath: base.keyPath.appending(path: \Value?.[default:DefaultSubscript(initialValue)])!
5151
)
5252
}
5353

Sources/ComposableArchitecture/SwiftUI/ForEachStore.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public struct ForEachStore<
143143
var element = element
144144
content(
145145
store.scope(
146-
id: store.id(state: \.[id: id]!, action: \.[id: id]),
146+
id: store.id(state: \.[id:id]!, action: \.[id:id]),
147147
state: ToState {
148148
element = $0[id: id] ?? element
149149
return element
@@ -207,7 +207,7 @@ public struct ForEachStore<
207207
let id = element[keyPath: viewStore.state.id]
208208
content(
209209
store.scope(
210-
id: store.id(state: \.[id: id]!, action: \.[id: id]),
210+
id: store.id(state: \.[id:id]!, action: \.[id:id]),
211211
state: ToState {
212212
element = $0[id: id] ?? element
213213
return element

0 commit comments

Comments
 (0)