Skip to content

Commit 01bf549

Browse files
authored
Update formatters (#5933)
1 parent eef4219 commit 01bf549

File tree

18 files changed

+91
-78
lines changed

18 files changed

+91
-78
lines changed

Example/tvOSSample/tvOSSample/AppDelegate.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2020
var window: UIWindow?
2121

2222
func application(_ application: UIApplication,
23-
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?)
23+
didFinishLaunchingWithOptions launchOptions: [
24+
UIApplicationLaunchOptionsKey: Any
25+
]?)
2426
-> Bool {
2527
// Override point for customization after application launch.
2628
FirebaseApp.configure()

FirebaseAuth/Sources/User/FIRUser.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
324324
forKey:kPhoneNumberCodingKey];
325325
BOOL emailVerified = [aDecoder decodeBoolForKey:kEmailVerifiedCodingKey];
326326
NSSet *providerDataClasses =
327-
[NSSet setWithArray:@ [[NSDictionary class], [NSString class], [FIRUserInfoImpl class]]];
327+
[NSSet setWithArray:@[ [NSDictionary class], [NSString class], [FIRUserInfoImpl class] ]];
328328
NSDictionary<NSString *, FIRUserInfoImpl *> *providerData =
329329
[aDecoder decodeObjectOfClasses:providerDataClasses forKey:kProviderDataKey];
330330
FIRSecureTokenService *tokenService = [aDecoder decodeObjectOfClass:[FIRSecureTokenService class]

FirebaseCore/Tests/Unit/FIRAppTest.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ - (void)tearDown {
8888
}
8989

9090
- (void)testConfigure {
91-
[self
92-
registerLibrariesWithClasses:@ [[FIRTestClassCached class], [FIRTestClassEagerCached class]]];
91+
[self registerLibrariesWithClasses:@[
92+
[FIRTestClassCached class], [FIRTestClassEagerCached class]
93+
]];
9394

9495
NSDictionary *expectedUserInfo = [self expectedUserInfoWithAppName:kFIRDefaultAppName
9596
isDefaultApp:YES];
@@ -329,8 +330,9 @@ - (void)testAppNamed {
329330
}
330331

331332
- (void)testDeleteApp {
332-
[self
333-
registerLibrariesWithClasses:@ [[FIRTestClassCached class], [FIRTestClassEagerCached class]]];
333+
[self registerLibrariesWithClasses:@[
334+
[FIRTestClassCached class], [FIRTestClassEagerCached class]
335+
]];
334336

335337
NSString *name = NSStringFromSelector(_cmd);
336338
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID

FirebaseCore/Tests/Unit/FIRComponentContainerTest.m

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ - (void)testRegisteringConformingClass {
7171
}
7272

7373
- (void)testComponentsPopulatedOnInit {
74-
FIRComponentContainer *container = [self containerWithRegistrants:@ [[FIRTestClass class]]];
74+
FIRComponentContainer *container = [self containerWithRegistrants:@[ [FIRTestClass class] ]];
7575

7676
// Verify that the block is stored.
7777
NSString *protocolName = NSStringFromProtocol(@protocol(FIRTestProtocol));
@@ -82,7 +82,8 @@ - (void)testComponentsPopulatedOnInit {
8282
#pragma mark - Caching Tests
8383

8484
- (void)testInstanceCached {
85-
FIRComponentContainer *container = [self containerWithRegistrants:@ [[FIRTestClassCached class]]];
85+
FIRComponentContainer *container =
86+
[self containerWithRegistrants:@[ [FIRTestClassCached class] ]];
8687

8788
// Fetch an instance for `FIRTestProtocolCached`, then fetch it again to assert it's cached.
8889
id<FIRTestProtocolCached> instance1 = FIR_COMPONENT(FIRTestProtocolCached, container);
@@ -93,7 +94,7 @@ - (void)testInstanceCached {
9394
}
9495

9596
- (void)testInstanceNotCached {
96-
FIRComponentContainer *container = [self containerWithRegistrants:@ [[FIRTestClass class]]];
97+
FIRComponentContainer *container = [self containerWithRegistrants:@[ [FIRTestClass class] ]];
9798

9899
// Retrieve an instance from the container, then fetch it again and ensure it's not the same
99100
// instance.
@@ -105,10 +106,10 @@ - (void)testInstanceNotCached {
105106
}
106107

107108
- (void)testRemoveAllCachedInstances {
108-
FIRComponentContainer *container =
109-
[self containerWithRegistrants:@ [[FIRTestClass class], [FIRTestClassCached class],
110-
[FIRTestClassEagerCached class],
111-
[FIRTestClassCachedWithDep class]]];
109+
FIRComponentContainer *container = [self containerWithRegistrants:@[
110+
[FIRTestClass class], [FIRTestClassCached class], [FIRTestClassEagerCached class],
111+
[FIRTestClassCachedWithDep class]
112+
]];
112113

113114
// Retrieve an instance of FIRTestClassCached to ensure it's cached.
114115
id<FIRTestProtocolCached> cachedInstance1 = FIR_COMPONENT(FIRTestProtocolCached, container);
@@ -131,10 +132,10 @@ - (void)testRemoveAllCachedInstances {
131132
}
132133

133134
- (void)testRemoveAllComponents {
134-
FIRComponentContainer *container =
135-
[self containerWithRegistrants:@ [[FIRTestClass class], [FIRTestClassCached class],
136-
[FIRTestClassEagerCached class],
137-
[FIRTestClassCachedWithDep class]]];
135+
FIRComponentContainer *container = [self containerWithRegistrants:@[
136+
[FIRTestClass class], [FIRTestClassCached class], [FIRTestClassEagerCached class],
137+
[FIRTestClassCachedWithDep class]
138+
]];
138139

139140
// Retrieve an instance of FIRTestClassCached to ensure it's cached.
140141
id<FIRTestProtocolCached> cachedInstance1 = FIR_COMPONENT(FIRTestProtocolCached, container);
@@ -167,7 +168,7 @@ - (void)testEagerInstantiation {
167168
// implementation for `FIRTestProtocolEagerCached` and requires eager instantiation as well as
168169
// caching so the test can verify it was eagerly instantiated.
169170
FIRComponentContainer *container =
170-
[self containerWithRegistrants:@ [[FIRTestClassEagerCached class]]];
171+
[self containerWithRegistrants:@[ [FIRTestClassEagerCached class] ]];
171172
NSString *protocolName = NSStringFromProtocol(@protocol(FIRTestProtocolEagerCached));
172173
XCTAssertNotNil(container.cachedInstances[protocolName]);
173174
}
@@ -181,7 +182,7 @@ - (void)testProtocolAlreadyRegistered {
181182
// change in the future.
182183
// TODO(wilsonryan): Assert that the log gets called warning that it's already been registered.
183184
FIRComponentContainer *container =
184-
[self containerWithRegistrants:@ [[FIRTestClass class], [FIRTestClassDuplicate class]]];
185+
[self containerWithRegistrants:@[ [FIRTestClass class], [FIRTestClassDuplicate class] ]];
185186
XCTAssert(container.components.count == 1);
186187
}
187188

@@ -190,7 +191,7 @@ - (void)testProtocolAlreadyRegistered {
190191
- (void)testDependencyDoesntBlock {
191192
/// Test a class that has a dependency, and fetching doesn't block the internal queue.
192193
FIRComponentContainer *container = [self
193-
containerWithRegistrants:@ [[FIRTestClassCached class], [FIRTestClassCachedWithDep class]]];
194+
containerWithRegistrants:@[ [FIRTestClassCached class], [FIRTestClassCachedWithDep class] ]];
194195
XCTAssert(container.components.count == 2);
195196

196197
id<FIRTestProtocolCachedWithDep> instanceWithDep =
@@ -201,7 +202,7 @@ - (void)testDependencyDoesntBlock {
201202
- (void)testDependencyRemoveAllCachedInstancesDoesntBlock {
202203
/// Test a class that has a dependency, and fetching doesn't block the internal queue.
203204
FIRComponentContainer *container = [self
204-
containerWithRegistrants:@ [[FIRTestClassCached class], [FIRTestClassCachedWithDep class]]];
205+
containerWithRegistrants:@[ [FIRTestClassCached class], [FIRTestClassCachedWithDep class] ]];
205206
XCTAssert(container.components.count == 2);
206207

207208
id<FIRTestProtocolCachedWithDep> instanceWithDep =

FirebaseDatabase/Sources/Core/FQueryParams.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ - (BOOL)isEqual:(id)obj {
358358
return NO;
359359
if (self->_limit != other->_limit)
360360
return NO;
361-
if ((self->_index != other->_index) && !
362-
[self->_index isEqual:other->_index])
361+
if ((self->_index != other->_index) &&
362+
![self->_index isEqual:other->_index])
363363
return NO;
364364
if ((self->_indexStartKey != other->_indexStartKey) &&
365365
![self->_indexStartKey isEqualToString:other->_indexStartKey])

FirebaseDatabase/Tests/Integration/FData.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,9 @@ - (void)testWriteLeafNodeOverwriteAtParentMultipleTimesVerifyExpectedEvents {
314314
ios - sdk / firebase - ios -
315315
sdk / Example / Database / Tests / Helpers /
316316
FEventTester
317-
.m : 123 because it was raised inside test case -
318-
[FEventTester(
319-
null)] which has no associated XCTestRun object.This may happen when test cases
320-
are constructed and invoked independently of standard XCTest infrastructure,
317+
.m : 123 because it was raised inside test case -[FEventTester(null)] which has no
318+
associated XCTestRun object.This may happen when test cases are
319+
constructed and invoked independently of standard XCTest infrastructure,
321320
or when the test has already finished
322321
." - Expected http://localhost:9000/-M8IJYWb68MuqQKKz2IY/a aa (0) to match "
323322
"http://localhost:9000/-M8IJYWb68MuqQKKz2IY/a (null) (4)' from "

FirebaseMessaging/Apps/Sample/Sample/SceneDelegate.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, MessagingDelegate {
3838
window
3939
.rootViewController = UIHostingController(rootView: contentView
4040
.environmentObject(identity)
41-
.environmentObject(settings)
42-
)
41+
.environmentObject(settings))
4342

4443
self.window = window
4544
window.makeKeyAndVisible()

FirebaseMessaging/Apps/Sample/iOS/AppDelegate.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3434
static var hasPresentedInvalidServiceInfoPlistAlert = false
3535

3636
func application(_ application: UIApplication,
37-
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?)
37+
didFinishLaunchingWithOptions launchOptions: [
38+
UIApplicationLaunchOptionsKey: Any
39+
]?)
3840
-> Bool {
3941
guard !AppDelegate.isWithinUnitTest else {
4042
// During unit tests, we don't want to initialize Firebase, since by default we want to able
@@ -91,7 +93,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
9193
didReceiveRemoteNotification userInfo: [AnyHashable: Any],
9294
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult)
9395
-> Void) {
94-
print("application:didReceiveRemoteNotification:fetchCompletionHandler: called, with notification:")
96+
print(
97+
"application:didReceiveRemoteNotification:fetchCompletionHandler: called, with notification:"
98+
)
9599
print("\(userInfo.jsonString ?? "{}")")
96100
completionHandler(.newData)
97101
}
@@ -127,7 +131,9 @@ extension AppDelegate: MessagingDelegate {
127131
func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage) {
128132
// Convert to pretty-print JSON
129133
guard let prettyPrinted = remoteMessage.appData.jsonString else {
130-
print("Received direct channel message, but could not parse as JSON: \(remoteMessage.appData)")
134+
print(
135+
"Received direct channel message, but could not parse as JSON: \(remoteMessage.appData)"
136+
)
131137
return
132138
}
133139
print("Received direct channel message:\n\(prettyPrinted)")

FirebaseRemoteConfig/Sources/RCNDevice.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ BOOL FIRRemoteConfigHasDeviceContextChanged(NSDictionary *deviceContext,
224224
if (![deviceContext[RCNDeviceContextKeyBuild] isEqual:FIRRemoteConfigAppBuildVersion()]) {
225225
return YES;
226226
}
227-
if (!
228-
[deviceContext[RCNDeviceContextKeyOSVersion] isEqual:[GULAppEnvironmentUtil systemVersion]]) {
227+
if (![deviceContext[RCNDeviceContextKeyOSVersion]
228+
isEqual:[GULAppEnvironmentUtil systemVersion]]) {
229229
return YES;
230230
}
231231
if (![deviceContext[RCNDeviceContextKeyDeviceLocale] isEqual:FIRRemoteConfigDeviceLocale()]) {

FirebaseStorageSwift/Sources/SwiftAPIExtension.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import FirebaseStorage
2222
/// an `Error`.
2323
/// - Returns: A closure parameterized with an optional generic and optional `Error` to match
2424
/// Objective C APIs.
25-
private func getResultCallback<T>(
26-
completion: @escaping (Result<T, Error>) -> Void
27-
) -> (_: T?, _: Error?) -> Void {
25+
private func getResultCallback<T>(completion: @escaping (Result<T, Error>) -> Void) -> (_: T?,
26+
_: Error?)
27+
-> Void {
2828
return { (value: T?, error: Error?) -> Void in
2929
if let value = value {
3030
completion(.success(value))

0 commit comments

Comments
 (0)