Skip to content

Commit c6328a0

Browse files
authored
Cherry-picks for M94 (#7913)
1 parent 05f796c commit c6328a0

File tree

26 files changed

+90
-36
lines changed

26 files changed

+90
-36
lines changed

Firebase/InstanceID/Public/FIRInstanceID.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ NS_ASSUME_NONNULL_BEGIN
2424
*
2525
* The scope to be used when fetching/deleting a token for Firebase Messaging.
2626
*/
27+
// clang-format off
28+
// clang-format12 merges the next two lines.
2729
FOUNDATION_EXPORT NSString *const kFIRInstanceIDScopeFirebaseMessaging
2830
NS_SWIFT_NAME(InstanceIDScopeFirebaseMessaging) DEPRECATED_ATTRIBUTE;
31+
// clang-format on
2932

3033
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
3134
/**
@@ -36,8 +39,11 @@ FOUNDATION_EXPORT NSString *const kFIRInstanceIDScopeFirebaseMessaging
3639
* Instance ID service will throttle the refresh event across all devices
3740
* to control the rate of token updates on application servers.
3841
*/
42+
// clang-format off
43+
// clang-format12 merges the next two lines.
3944
FOUNDATION_EXPORT const NSNotificationName kFIRInstanceIDTokenRefreshNotification
4045
NS_SWIFT_NAME(InstanceIDTokenRefresh) DEPRECATED_ATTRIBUTE;
46+
// clang-format on
4147
#else
4248
/**
4349
* Called when the system determines that tokens need to be refreshed.
@@ -47,8 +53,11 @@ FOUNDATION_EXPORT const NSNotificationName kFIRInstanceIDTokenRefreshNotificatio
4753
* Instance ID service will throttle the refresh event across all devices
4854
* to control the rate of token updates on application servers.
4955
*/
56+
// clang-format off
57+
// clang-format12 merges the next two lines.
5058
FOUNDATION_EXPORT NSString *const kFIRInstanceIDTokenRefreshNotification
5159
NS_SWIFT_NAME(InstanceIDTokenRefreshNotification) DEPRECATED_ATTRIBUTE;
60+
// clang-format on
5261
#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
5362

5463
/**

FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRLifecycleEvents.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ NS_ASSUME_NONNULL_BEGIN
1919
/// Default event name for when an experiment is set.
2020
extern NSString *const FIRSetExperimentEventName NS_SWIFT_NAME(DefaultSetExperimentEventName);
2121
/// Default event name for when an experiment is activated.
22+
// clang-format off
23+
// clang-format12 will merge lines and exceed 100 character limit.
2224
extern NSString *const FIRActivateExperimentEventName
2325
NS_SWIFT_NAME(DefaultActivateExperimentEventName);
2426
/// Default event name for when an experiment is cleared.
2527
extern NSString *const FIRClearExperimentEventName NS_SWIFT_NAME(DefaultClearExperimentEventName);
2628
/// Default event name for when an experiment times out for being activated.
2729
extern NSString *const FIRTimeoutExperimentEventName
2830
NS_SWIFT_NAME(DefaultTimeoutExperimentEventName);
31+
// clang-format on
2932
/// Default event name for when an experiment is expired as it reaches the end of TTL.
3033
extern NSString *const FIRExpireExperimentEventName NS_SWIFT_NAME(DefaultExpireExperimentEventName);
3134

FirebaseAppDistribution/Sources/Public/FirebaseAppDistribution/FIRAppDistribution.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,15 @@ NS_SWIFT_NAME(AppDistribution)
6363
@end
6464

6565
/// The error domain for codes in the `FIRAppDistributionError` enum.
66+
// clang-format off
67+
// clang-format12 will merge lines and exceed 100 character limit.
6668
FOUNDATION_EXPORT NSString *const FIRAppDistributionErrorDomain
6769
NS_SWIFT_NAME(AppDistributionErrorDomain);
6870

6971
/// The key for finding error details in the `NSError`'s `userInfo`.
7072
FOUNDATION_EXPORT NSString *const FIRAppDistributionErrorDetailsKey
7173
NS_SWIFT_NAME(FunctionsErrorDetailsKey);
74+
// clang-format on
7275

7376
/**
7477
* Error codes representing sign in or version check failure reasons.

FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ typedef void (^FIRUserUpdateCallback)(NSError *_Nullable error) NS_SWIFT_NAME(Us
4444
/** @typedef FIRAuthStateDidChangeListenerHandle
4545
@brief The type of handle returned by `FIRAuth.addAuthStateDidChangeListener:`.
4646
*/
47+
// clang-format off
48+
// clang-format12 merges the next two lines.
4749
typedef id<NSObject> FIRAuthStateDidChangeListenerHandle
4850
NS_SWIFT_NAME(AuthStateDidChangeListenerHandle);
51+
// clang-format on
4952

5053
/** @typedef FIRAuthStateDidChangeListenerBlock
5154
@brief The type of block which can be registered as a listener for auth state did change events.
@@ -59,8 +62,11 @@ typedef void (^FIRAuthStateDidChangeListenerBlock)(FIRAuth *auth, FIRUser *_Null
5962
/** @typedef FIRIDTokenDidChangeListenerHandle
6063
@brief The type of handle returned by `FIRAuth.addIDTokenDidChangeListener:`.
6164
*/
65+
// clang-format off
66+
// clang-format12 merges the next two lines.
6267
typedef id<NSObject> FIRIDTokenDidChangeListenerHandle
6368
NS_SWIFT_NAME(IDTokenDidChangeListenerHandle);
69+
// clang-format on
6470

6571
/** @typedef FIRIDTokenDidChangeListenerBlock
6672
@brief The type of block which can be registered as a listener for ID token did change events.
@@ -95,8 +101,11 @@ extern const NSNotificationName FIRAuthStateDidChangeNotification NS_SWIFT_NAME(
95101
changes (for example, a new token has been produced, a user signs in or signs out). The
96102
object parameter of the notification is the sender `FIRAuth` instance.
97103
*/
104+
// clang-format off
105+
// clang-format12 merges the next two lines.
98106
extern NSString *const FIRAuthStateDidChangeNotification
99107
NS_SWIFT_NAME(AuthStateDidChangeNotification);
108+
// clang-format off
100109
#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
101110

102111
/** @typedef FIRAuthResultCallback

FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ extern NSString *const FIRAuthErrorUserInfoEmailKey NS_SWIFT_NAME(AuthErrorUserI
6565
NSError object returned. This is the updated auth credential the developer should use for
6666
recovery if applicable.
6767
*/
68+
// clang-format off
69+
// clang-format12 will merge lines and exceed 100 character limit.
6870
extern NSString *const FIRAuthErrorUserInfoUpdatedCredentialKey
6971
NS_SWIFT_NAME(AuthErrorUserInfoUpdatedCredentialKey);
7072

@@ -74,6 +76,7 @@ extern NSString *const FIRAuthErrorUserInfoUpdatedCredentialKey
7476
*/
7577
extern NSString *const FIRAuthErrorUserInfoMultiFactorResolverKey
7678
NS_SWIFT_NAME(AuthErrorUserInfoMultiFactorResolverKey);
79+
// clang-format on
7780

7881
/**
7982
@brief Error codes used by Firebase Auth.

FirebaseAuth/Sources/Public/FirebaseAuth/FIREmailAuthProvider.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ extern NSString *const FIREmailLinkAuthSignInMethod NS_SWIFT_NAME(EmailLinkAuthS
3333
/**
3434
@brief A string constant identifying the email & password sign-in method.
3535
*/
36+
// clang-format off
37+
// clang-format12 merges the next two lines.
3638
extern NSString *const FIREmailPasswordAuthSignInMethod
3739
NS_SWIFT_NAME(EmailPasswordAuthSignInMethod);
40+
// clang-format on
3841

3942
/** @class FIREmailAuthProvider
4043
@brief A concrete implementation of `FIRAuthProvider` for Email & Password Sign In.

FirebaseAuth/Tests/Unit/FIRAuthAppCredentialManagerTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#import "FirebaseAuth/Sources/SystemService/FIRAuthAppCredential.h"
2525
#import "FirebaseAuth/Sources/SystemService/FIRAuthAppCredentialManager.h"
2626

27-
#define ANY_ERROR_POINTER ((NSError * __autoreleasing * _Nullable)[OCMArg anyPointer])
27+
#define ANY_ERROR_POINTER ((NSError * __autoreleasing *_Nullable)[OCMArg anyPointer])
2828
#define SAVE_TO(var) \
2929
[OCMArg checkWithBlock:^BOOL(id arg) { \
3030
var = arg; \

FirebaseDatabase/Sources/Api/Private/FTypedefs_Private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ typedef NS_ENUM(NSInteger, FTransactionStatus) {
3838
typedef void (^fbt_void_nserror_bool_datasnapshot)(NSError *error,
3939
BOOL committed,
4040
FIRDataSnapshot *snapshot);
41-
typedef FIRTransactionResult * (^fbt_transactionresult_mutabledata)(
42-
FIRMutableData *currentData);
41+
typedef FIRTransactionResult * (
42+
^fbt_transactionresult_mutabledata)(FIRMutableData *currentData);
4343
typedef void (^fbt_void_path_node)(FPath *, id<FNode>);
4444
typedef void (^fbt_void_nsstring)(NSString *);
4545
typedef BOOL (^fbt_bool_nsstring_node)(NSString *, id<FNode>);

FirebaseDatabase/Sources/Core/FWriteTree.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ - (NSArray *)removeAllWrites {
256256
return nil;
257257
} else {
258258
BOOL (^filter)(FWriteRecord *) = ^(FWriteRecord *record) {
259-
return (BOOL)(
260-
(record.visible || includeHiddenWrites) &&
261-
(writeIdsToExclude == nil ||
262-
![writeIdsToExclude
263-
containsObject:
264-
[NSNumber numberWithInteger:record.writeId]]) &&
265-
([record.path contains:treePath] ||
266-
[treePath contains:record.path]));
259+
return (BOOL)((record.visible || includeHiddenWrites) &&
260+
(writeIdsToExclude == nil ||
261+
![writeIdsToExclude
262+
containsObject:[NSNumber
263+
numberWithInteger:
264+
record.writeId]]) &&
265+
([record.path contains:treePath] ||
266+
[treePath contains:record.path]));
267267
};
268268
FCompoundWrite *mergeAtPath =
269269
[FWriteTree layerTreeFromWrites:self.allWrites

FirebaseDatabase/Tests/Integration/FIRDatabaseTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ @interface FIRDatabaseTests : FTestBase
3737
@implementation FIRDatabaseTests
3838

3939
- (void)testFIRDatabaseForNilApp {
40-
XCTAssertThrowsSpecificNamed([FIRDatabase databaseForApp:(FIRApp * _Nonnull) nil], NSException,
40+
XCTAssertThrowsSpecificNamed([FIRDatabase databaseForApp:(FIRApp *_Nonnull)nil], NSException,
4141
@"InvalidFIRApp");
4242
}
4343

@@ -92,7 +92,7 @@ - (void)testDifferentInstanceForAppWithURL {
9292
- (void)testDatabaseForAppWithInvalidCustomURLs {
9393
id app = [[FIRFakeApp alloc] initWithName:@"testDatabaseForAppWithInvalidCustomURLs"
9494
URL:kFirebaseTestAltNamespace];
95-
XCTAssertThrows([FIRDatabase databaseForApp:app URL:(NSString * _Nonnull) nil]);
95+
XCTAssertThrows([FIRDatabase databaseForApp:app URL:(NSString *_Nonnull)nil]);
9696
XCTAssertThrows([FIRDatabase databaseForApp:app URL:@"not-a-url"]);
9797
XCTAssertThrows([FIRDatabase databaseForApp:app URL:@"http://x.fblocal.com:9000/paths/are/bad"]);
9898
}

0 commit comments

Comments
 (0)