Skip to content

Commit 1af0bf0

Browse files
authored
Update to SwiftFormat 0.53.5 (#12665)
1 parent 385bfdc commit 1af0bf0

File tree

9 files changed

+85
-87
lines changed

9 files changed

+85
-87
lines changed

CoreOnly/Tests/FirebasePodTest/FirebasePodTest/AppDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
import Firebase
16+
1617
// Verify that the following Firebase Swift APIs can be found.
1718
import FirebaseAnalyticsSwift
1819
import FirebaseFirestoreSwift

FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatsBundle.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ struct HeartbeatsBundle: Codable, HeartbeatsPayloadConvertible {
7272
}
7373

7474
// Update cache with the new heartbeat's date.
75-
heartbeat.timePeriods.forEach {
76-
lastAddedHeartbeatDates[$0] = heartbeat.date
75+
for timePeriod in heartbeat.timePeriods {
76+
lastAddedHeartbeatDates[timePeriod] = heartbeat.date
7777
}
7878

7979
} catch let error as RingBuffer<Heartbeat>.Error {
@@ -98,8 +98,8 @@ struct HeartbeatsBundle: Codable, HeartbeatsPayloadConvertible {
9898

9999
if case .success = secondPushAttempt {
100100
// Update cache with the new heartbeat's date.
101-
diagnosticHeartbeat.timePeriods.forEach {
102-
lastAddedHeartbeatDates[$0] = diagnosticHeartbeat.date
101+
for timePeriod in diagnosticHeartbeat.timePeriods {
102+
lastAddedHeartbeatDates[timePeriod] = diagnosticHeartbeat.date
103103
}
104104
}
105105
} catch {
@@ -124,9 +124,9 @@ struct HeartbeatsBundle: Codable, HeartbeatsPayloadConvertible {
124124
poppedHeartbeats.append(poppedHeartbeat)
125125
}
126126

127-
poppedHeartbeats.reversed().forEach {
127+
for poppedHeartbeat in poppedHeartbeats.reversed() {
128128
do {
129-
try buffer.push($0)
129+
try buffer.push(poppedHeartbeat)
130130
} catch {
131131
// Ignore error.
132132
}

FirebaseCore/Internal/Tests/Unit/HeartbeatStorageTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
@testable import FirebaseCoreInternal
1616
import XCTest
17+
1718
class HeartbeatStorageTests: XCTestCase {
1819
// MARK: - Instance Management
1920

FirebaseCore/Internal/Tests/Unit/HeartbeatTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class TimePeriodTests: XCTestCase {
2121
}
2222

2323
func testTimeIntervals() throws {
24-
TimePeriod.allCases.forEach { period in
24+
for period in TimePeriod.allCases {
2525
XCTAssertEqual(period.timeInterval, Double(period.rawValue) * 86400)
2626
}
2727
}

FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigSwift.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
@_exported import enum FirebaseRemoteConfig.RemoteConfigCodableError
2020
@_exported import struct FirebaseRemoteConfig.RemoteConfigProperty
21+
2122
// The `@_exported` is needed to prevent breaking clients that are using
2223
// types prefixed with the `FirebaseRemoteConfigSwift` module name (e.g.
2324
// `FirebaseRemoteConfigSwift.RemoteConfigValueCodableError`).

FirebaseSessions/Sources/FirebaseSessions.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ private enum GoogleDataTransportConfig {
142142

143143
super.init()
144144

145-
SessionsDependencies.dependencies.forEach { subscriberName in
146-
self.subscriberPromises[subscriberName] = Promise<Void>.pending()
145+
for subscriberName in SessionsDependencies.dependencies {
146+
subscriberPromises[subscriberName] = Promise<Void>.pending()
147147
}
148148

149149
Logger
@@ -226,10 +226,10 @@ private enum GoogleDataTransportConfig {
226226
}
227227

228228
func addSubscriberFields(event: SessionStartEvent) {
229-
subscribers.forEach { subscriber in
229+
for subscriber in subscribers {
230230
event.set(subscriber: subscriber.sessionsSubscriberName,
231231
isDataCollectionEnabled: subscriber.isDataCollectionEnabled,
232-
appInfo: self.appInfo)
232+
appInfo: appInfo)
233233
}
234234
}
235235

FirebaseSessions/Sources/Installations+InstallationsProtocol.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import Foundation
1717

1818
@_implementationOnly import FirebaseInstallations
19+
1920
protocol InstallationsProtocol {
2021
var installationsWaitTimeInSecond: Int { get }
2122

FirebaseSessions/Tests/Unit/SessionStartEventTests.swift

Lines changed: 69 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ class SessionStartEventTests: XCTestCase {
159159
("something unknown", firebase_appquality_sessions_OsName_UNKNOWN_OSNAME),
160160
]
161161

162-
expectations.forEach { (given: String, expected: firebase_appquality_sessions_OsName) in
162+
for (given, expected) in expectations {
163163
appInfo.osName = given
164164

165165
let event = SessionStartEvent(
166-
sessionInfo: self.defaultSessionInfo,
166+
sessionInfo: defaultSessionInfo,
167167
appInfo: appInfo,
168168
time: time
169169
)
@@ -188,17 +188,16 @@ class SessionStartEventTests: XCTestCase {
188188
),
189189
]
190190

191-
expectations.forEach { (given: DevEnvironment,
192-
expected: firebase_appquality_sessions_LogEnvironment) in
193-
appInfo.environment = given
191+
for (given, expected) in expectations {
192+
appInfo.environment = given
194193

195-
let event = SessionStartEvent(
196-
sessionInfo: self.defaultSessionInfo,
197-
appInfo: appInfo,
198-
time: time
199-
)
194+
let event = SessionStartEvent(
195+
sessionInfo: defaultSessionInfo,
196+
appInfo: appInfo,
197+
time: time
198+
)
200199

201-
XCTAssertEqual(event.proto.application_info.log_environment, expected)
200+
XCTAssertEqual(event.proto.application_info.log_environment, expected)
202201
}
203202
}
204203

@@ -304,27 +303,26 @@ class SessionStartEventTests: XCTestCase {
304303
),
305304
]
306305

307-
expectations.forEach { (given: GULNetworkType,
308-
expected: firebase_appquality_sessions_NetworkConnectionInfo_NetworkType) in
309-
let mockNetworkInfo = MockNetworkInfo()
310-
mockNetworkInfo.networkType = given
311-
appInfo.networkInfo = mockNetworkInfo
306+
for (given, expected) in expectations {
307+
let mockNetworkInfo = MockNetworkInfo()
308+
mockNetworkInfo.networkType = given
309+
appInfo.networkInfo = mockNetworkInfo
312310

313-
let event = SessionStartEvent(
314-
sessionInfo: self.defaultSessionInfo,
315-
appInfo: appInfo,
316-
time: time
317-
)
311+
let event = SessionStartEvent(
312+
sessionInfo: defaultSessionInfo,
313+
appInfo: appInfo,
314+
time: time
315+
)
318316

319-
// These fields will only be filled in when the Perf SDK is installed
320-
event.set(subscriber: .Performance, isDataCollectionEnabled: true, appInfo: appInfo)
317+
// These fields will only be filled in when the Perf SDK is installed
318+
event.set(subscriber: .Performance, isDataCollectionEnabled: true, appInfo: appInfo)
321319

322-
testProtoAndDecodedProto(sessionEvent: event) { proto in
323-
XCTAssertEqual(
324-
event.proto.application_info.apple_app_info.network_connection_info.network_type,
325-
expected
326-
)
327-
}
320+
testProtoAndDecodedProto(sessionEvent: event) { proto in
321+
XCTAssertEqual(
322+
event.proto.application_info.apple_app_info.network_connection_info.network_type,
323+
expected
324+
)
325+
}
328326
}
329327
}
330328

@@ -385,30 +383,28 @@ class SessionStartEventTests: XCTestCase {
385383
),
386384
]
387385

388-
expectations
389-
.forEach { (given: String,
390-
expected: firebase_appquality_sessions_NetworkConnectionInfo_MobileSubtype) in
391-
let mockNetworkInfo = MockNetworkInfo()
392-
mockNetworkInfo.mobileSubtype = given
393-
appInfo.networkInfo = mockNetworkInfo
394-
395-
let event = SessionStartEvent(
396-
sessionInfo: self.defaultSessionInfo,
397-
appInfo: appInfo,
398-
time: time
399-
)
400-
401-
// These fields will only be filled in when the Perf SDK is installed
402-
event.set(subscriber: .Performance, isDataCollectionEnabled: true, appInfo: appInfo)
403-
404-
testProtoAndDecodedProto(sessionEvent: event) { proto in
405-
XCTAssertEqual(
406-
event.proto.application_info.apple_app_info.network_connection_info
407-
.mobile_subtype,
408-
expected
409-
)
410-
}
386+
for (given, expected) in expectations {
387+
let mockNetworkInfo = MockNetworkInfo()
388+
mockNetworkInfo.mobileSubtype = given
389+
appInfo.networkInfo = mockNetworkInfo
390+
391+
let event = SessionStartEvent(
392+
sessionInfo: defaultSessionInfo,
393+
appInfo: appInfo,
394+
time: time
395+
)
396+
397+
// These fields will only be filled in when the Perf SDK is installed
398+
event.set(subscriber: .Performance, isDataCollectionEnabled: true, appInfo: appInfo)
399+
400+
testProtoAndDecodedProto(sessionEvent: event) { proto in
401+
XCTAssertEqual(
402+
event.proto.application_info.apple_app_info.network_connection_info
403+
.mobile_subtype,
404+
expected
405+
)
411406
}
407+
}
412408
}
413409
#endif // os(iOS) && !targetEnvironment(macCatalyst)
414410

@@ -477,30 +473,28 @@ class SessionStartEventTests: XCTestCase {
477473
),
478474
]
479475

480-
expectations
481-
.forEach { (given: String,
482-
expected: firebase_appquality_sessions_NetworkConnectionInfo_MobileSubtype) in
483-
let mockNetworkInfo = MockNetworkInfo()
484-
mockNetworkInfo.mobileSubtype = given
485-
appInfo.networkInfo = mockNetworkInfo
486-
487-
let event = SessionStartEvent(
488-
sessionInfo: self.defaultSessionInfo,
489-
appInfo: appInfo,
490-
time: time
491-
)
492-
493-
// These fields will only be filled in when the Perf SDK is installed
494-
event.set(subscriber: .Performance, isDataCollectionEnabled: true, appInfo: appInfo)
495-
496-
testProtoAndDecodedProto(sessionEvent: event) { proto in
497-
XCTAssertEqual(
498-
event.proto.application_info.apple_app_info.network_connection_info
499-
.mobile_subtype,
500-
expected
501-
)
502-
}
476+
for (given, expected) in expectations {
477+
let mockNetworkInfo = MockNetworkInfo()
478+
mockNetworkInfo.mobileSubtype = given
479+
appInfo.networkInfo = mockNetworkInfo
480+
481+
let event = SessionStartEvent(
482+
sessionInfo: defaultSessionInfo,
483+
appInfo: appInfo,
484+
time: time
485+
)
486+
487+
// These fields will only be filled in when the Perf SDK is installed
488+
event.set(subscriber: .Performance, isDataCollectionEnabled: true, appInfo: appInfo)
489+
490+
testProtoAndDecodedProto(sessionEvent: event) { proto in
491+
XCTAssertEqual(
492+
event.proto.application_info.apple_app_info.network_connection_info
493+
.mobile_subtype,
494+
expected
495+
)
503496
}
497+
}
504498
}
505499
#endif // os(iOS) && !targetEnvironment(macCatalyst)
506500
}

Mintfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nicklockwood/SwiftFormat@0.52.10
1+
nicklockwood/SwiftFormat@0.53.5

0 commit comments

Comments
 (0)