소스 검색

[Infra] Upgrade to clang-format16 (#10973)

Nick Cooke 3 년 전
부모
커밋
867697b8f3

+ 1 - 1
CONTRIBUTING.md

@@ -132,7 +132,7 @@ To develop Firebase software, **install**:
    To install [clang-format] and [mint] using [Homebrew]:
 
     ```console
-    brew install clang-format@15
+    brew install clang-format@16
     brew install mint
     ```
 

+ 3 - 2
Crashlytics/Crashlytics/Helpers/FIRCLSDefines.h

@@ -23,8 +23,9 @@
 // These macros generate a function to force a symbol for the containing .o, to work around an issue
 // where strip will not strip debug information without a symbol to strip.
 #define DUMMY_FUNCTION_NAME(x) CONCAT(fircls_strip_this_, x)
-#define INJECT_STRIP_SYMBOL(x) \
-  void DUMMY_FUNCTION_NAME(x)(void) {}
+#define INJECT_STRIP_SYMBOL(x)        \
+  void DUMMY_FUNCTION_NAME(x)(void) { \
+  }
 
 // These make some target os types available to previous versions of xcode that do not yet have them
 // in their SDKs

+ 2 - 2
Crashlytics/Shared/FIRCLSMachO/FIRCLSCodeMapping.m

@@ -22,11 +22,11 @@
 
 @implementation FIRCLSCodeMapping
 
-+ (instancetype)mappingWithURL:(NSURL*)URL {
++ (instancetype)mappingWithURL:(NSURL *)URL {
   return [[self alloc] initWithURL:URL];
 }
 
-- (instancetype)initWithURL:(NSURL*)URL {
+- (instancetype)initWithURL:(NSURL *)URL {
   self = [super init];
   if (!self) {
     return nil;

+ 1 - 1
Crashlytics/UnitTests/FIRCLSDwarfExpressionTests.m

@@ -131,7 +131,7 @@
   uint8_t fakeData;
   FIRCLSThreadContext registers;
 
-  XCTAssert(FIRCLSDwarfExpressionMachineInit(&machine, (void*)&fakeData, &registers, 42));
+  XCTAssert(FIRCLSDwarfExpressionMachineInit(&machine, (void *)&fakeData, &registers, 42));
   XCTAssert(FIRCLSDwarfExpressionStackIsValid(&machine.stack));
 
   XCTAssertEqual(FIRCLSDwarfExpressionStackPeek(&machine.stack), 42);

+ 2 - 2
FirebaseDatabase/Tests/Helpers/SenTest+FWaiter.h

@@ -19,10 +19,10 @@
 @interface XCTest (FWaiter)
 
 - (NSTimeInterval)waitUntil:(BOOL (^)(void))predicate;
-- (NSTimeInterval)waitUntil:(BOOL (^)(void))predicate description:(NSString*)desc;
+- (NSTimeInterval)waitUntil:(BOOL (^)(void))predicate description:(NSString *)desc;
 - (NSTimeInterval)waitUntil:(BOOL (^)(void))predicate timeout:(NSTimeInterval)seconds;
 - (NSTimeInterval)waitUntil:(BOOL (^)(void))predicate
                     timeout:(NSTimeInterval)seconds
-                description:(NSString*)desc;
+                description:(NSString *)desc;
 
 @end

+ 2 - 1
FirebaseDatabase/Tests/Integration/FData.m

@@ -328,7 +328,8 @@ This test flakes frequently on the emulator on travis and almost always on GHA w
                        "already finished." /
                   Users / runner / runners / 2.262.1 / work / firebase -
               ios - sdk / firebase - ios -
-              sdk / Example / Database / Tests / Helpers / FEventTester.m : 123
+              sdk / Example / Database / Tests / Helpers / FEventTester.m:
+123
 ``` FTupleEventTypeString *recvd = [self.actualPathsAndEvents objectAtIndex:i];
 XCTAssertTrue([target isEqualTo:recvd], @"Expected %@ to match %@", target, recvd);
 

+ 1 - 1
FirebaseInstallations/Source/Tests/Integration/FIRInstallationsIntegrationTests.m

@@ -15,7 +15,7 @@
  */
 
 // Uncomment or set the flag in GCC_PREPROCESSOR_DEFINITIONS to enable integration tests.
-//#define FIR_INSTALLATIONS_INTEGRATION_TESTS_REQUIRED 1
+// #define FIR_INSTALLATIONS_INTEGRATION_TESTS_REQUIRED 1
 
 // macOS requests a user password when accessing the Keychain for the first time,
 // so the tests may fail. Disable integration tests on macOS so far.

+ 2 - 2
FirebaseRemoteConfig/Tests/Sample/RemoteConfigSampleApp/FRCLog.h

@@ -19,6 +19,6 @@
 
 + (instancetype)sharedInstance;
 
-- (void)setLogView:(UITextView*)view;
-- (void)logToConsole:(NSString*)text;
+- (void)setLogView:(UITextView *)view;
+- (void)logToConsole:(NSString *)text;
 @end

+ 1 - 1
FirebaseRemoteConfig/Tests/Unit/RCNConfigAnalyticsTest.m

@@ -17,7 +17,7 @@
 #import <OCMock/OCMock.h>
 #import <XCTest/XCTest.h>
 
-//#import "RCNConfigAnalytics.h"
+// #import "RCNConfigAnalytics.h"
 
 @interface RCNConfigAnalyticsTest : XCTestCase {
   id _mockAnalytics;

+ 2 - 2
FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfig+FIRAppTest.m

@@ -17,10 +17,10 @@
 #import <OCMock/OCMock.h>
 #import <XCTest/XCTest.h>
 
-//#import "FIRRemoteConfig+FIRApp.h"
+// #import "FIRRemoteConfig+FIRApp.h"
 #import "FirebaseCore/Extension/FirebaseCoreInternal.h"
 #import "FirebaseRemoteConfig/Sources/Private/FIRRemoteConfig_Private.h"
-//#import "third_party/firebase/ios/Releases/FirebaseCore/Tests/FIRTestCase.h"
+// #import "third_party/firebase/ios/Releases/FirebaseCore/Tests/FIRTestCase.h"
 
 @interface RCNRemoteConfig_FIRAppTest : FIRTestCase
 

+ 1 - 1
Firestore/Source/API/FSTUserDataWriter.h

@@ -35,6 +35,6 @@ namespace api = firebase::firestore::api;
 - (instancetype)initWithFirestore:(std::shared_ptr<api::Firestore>)firestore
           serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior;
 
-- (id)convertedValue:(const firebase::firestore::google_firestore_v1_Value&)value;
+- (id)convertedValue:(const firebase::firestore::google_firestore_v1_Value &)value;
 
 @end

+ 1 - 1
README.md

@@ -140,7 +140,7 @@ GitHub Actions will verify that any code changes are done in a style compliant
 way. Install `clang-format` and `mint`:
 
 ```console
-brew install clang-format@15
+brew install clang-format@16
 brew install mint
 ```
 

+ 1 - 1
scripts/setup_check.sh

@@ -35,7 +35,7 @@ fi
 
 # install clang-format
 brew update
-brew install clang-format@15
+brew install clang-format@16
 
 # mint installs tools from Mintfile on demand.
 brew install mint

+ 2 - 2
scripts/style.sh

@@ -42,7 +42,7 @@ version="${version/ (*)/}"
 version="${version/.*/}"
 
 case "$version" in
-  15)
+  16)
     ;;
   google3-trunk)
     echo "Please use a publicly released clang-format; a recent LLVM release"
@@ -51,7 +51,7 @@ case "$version" in
     exit 1
     ;;
   *)
-    echo "Please upgrade to clang-format version 15."
+    echo "Please upgrade to clang-format version 16."
     echo "If it's installed via homebrew you can run:"
     echo "brew upgrade clang-format"
     exit 1