Browse Source

[Infra] Bump clang-format to v14 (#9527)

* Bump clang-format

* Review
Nick Cooke 4 years ago
parent
commit
0336856b9f

+ 1 - 2
FirebaseInstallations/Source/Library/Public/FirebaseInstallations/FIRInstallations.h

@@ -76,8 +76,7 @@ NS_SWIFT_NAME(Installations)
  * @returns An instance of `Installations` corresponding to the passed application.
  * @throw Throws an exception if required `FirebaseApp` options are missing.
  */
-+ (FIRInstallations *)installationsWithApp:(FIRApp *)application
-    NS_SWIFT_NAME(installations(app:));
++ (FIRInstallations *)installationsWithApp:(FIRApp *)application NS_SWIFT_NAME(installations(app:));
 
 /**
  * The method creates or retrieves an installation ID. The installation ID is a stable identifier

+ 1 - 2
FirebasePerformance/Sources/Public/FirebasePerformance/FIRHTTPMetric.h

@@ -54,8 +54,7 @@ NS_EXTENSION_UNAVAILABLE("Firebase Performance is not supported for extensions."
  * @param httpMethod HTTP method used by the request.
  */
 - (nullable instancetype)initWithURL:(nonnull NSURL *)URL
-                          HTTPMethod:(FIRHTTPMethod)httpMethod
-    NS_SWIFT_NAME(init(url:httpMethod:));
+                          HTTPMethod:(FIRHTTPMethod)httpMethod NS_SWIFT_NAME(init(url:httpMethod:));
 
 /**
  * Use `initWithURL:HTTPMethod:` for Objective-C and `init(url:httpMethod:)` for Swift.

+ 1 - 2
FirebasePerformance/Sources/Public/FirebasePerformance/FIRPerformance.h

@@ -62,8 +62,7 @@ NS_SWIFT_NAME(Performance)
  * @param name The name of the Trace.
  * @return The FIRTrace object.
  */
-+ (nullable FIRTrace *)startTraceWithName:(nonnull NSString *)name
-    NS_SWIFT_NAME(startTrace(name:));
++ (nullable FIRTrace *)startTraceWithName:(nonnull NSString *)name NS_SWIFT_NAME(startTrace(name:));
 
 /**
  * Creates an instance of FIRTrace. This API does not start the trace. To start the trace, use the

+ 6 - 12
Firestore/Source/API/FIRFilter+Internal.h

@@ -44,12 +44,10 @@ NS_SWIFT_NAME(Filter)
                   isGreaterThan:(nonnull id)value NS_SWIFT_NAME(whereField(_:isGreaterThan:));
 
 + (FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)field
-                      isGreaterThan:(nonnull id)value
-    NS_SWIFT_NAME(whereField(_:isGreaterThan:));
+                      isGreaterThan:(nonnull id)value NS_SWIFT_NAME(whereField(_:isGreaterThan:));
 
 + (FIRFilter *)filterWhereField:(nonnull NSString *)field
-         isGreaterThanOrEqualTo:(nonnull id)value
-    NS_SWIFT_NAME(whereField(_:isGreaterOrEqualTo:));
+         isGreaterThanOrEqualTo:(nonnull id)value NS_SWIFT_NAME(whereField(_:isGreaterOrEqualTo:));
 
 + (FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)field
              isGreaterThanOrEqualTo:(nonnull id)value
@@ -62,8 +60,7 @@ NS_SWIFT_NAME(Filter)
                          isLessThan:(nonnull id)value NS_SWIFT_NAME(whereField(_:isLessThan:));
 
 + (FIRFilter *)filterWhereField:(nonnull NSString *)field
-            isLessThanOrEqualTo:(nonnull id)value
-    NS_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:));
+            isLessThanOrEqualTo:(nonnull id)value NS_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:));
 
 + (FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)field
                 isLessThanOrEqualTo:(nonnull id)value
@@ -73,8 +70,7 @@ NS_SWIFT_NAME(Filter)
                   arrayContains:(nonnull id)value NS_SWIFT_NAME(whereField(_:arrayContains:));
 
 + (FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)field
-                      arrayContains:(nonnull id)value
-    NS_SWIFT_NAME(whereField(_:arrayContains:));
+                      arrayContains:(nonnull id)value NS_SWIFT_NAME(whereField(_:arrayContains:));
 
 + (FIRFilter *)filterWhereField:(nonnull NSString *)field
                arrayContainsAny:(nonnull NSArray<id> *)values
@@ -88,12 +84,10 @@ NS_SWIFT_NAME(Filter)
                              in:(nonnull NSArray<id> *)values NS_SWIFT_NAME(whereField(_:in:));
 
 + (FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)field
-                                 in:(nonnull NSArray<id> *)values
-    NS_SWIFT_NAME(whereField(_:in:));
+                                 in:(nonnull NSArray<id> *)values NS_SWIFT_NAME(whereField(_:in:));
 
 + (FIRFilter *)filterWhereField:(nonnull NSString *)field
-                          notIn:(nonnull NSArray<id> *)values
-    NS_SWIFT_NAME(whereField(_:notIn:));
+                          notIn:(nonnull NSArray<id> *)values NS_SWIFT_NAME(whereField(_:notIn:));
 
 + (FIRFilter *)filterWhereFieldPath:(nonnull FIRFieldPath *)field
                               notIn:(nonnull NSArray<id> *)values

+ 1 - 2
Firestore/Source/Public/FirebaseFirestore/FIRFirestore.h

@@ -292,8 +292,7 @@ NS_SWIFT_NAME(Firestore)
  * @return A `FIRLoadBundleTask` (`LoadBundleTask` in Swift) which allows registered observers
  * to receive progress updates and completion or error events.
  */
-- (FIRLoadBundleTask *)loadBundleStream:(NSInputStream *)bundleStream
-    NS_SWIFT_NAME(loadBundle(_:));
+- (FIRLoadBundleTask *)loadBundleStream:(NSInputStream *)bundleStream NS_SWIFT_NAME(loadBundle(_:));
 
 /**
  * Loads a Firestore bundle into the local cache.

+ 2 - 4
Firestore/Source/Public/FirebaseFirestore/FIRQuery.h

@@ -283,8 +283,7 @@ NS_SWIFT_NAME(Query)
  * @return The created `FIRQuery`.
  */
 - (FIRQuery *)queryWhereField:(NSString *)field
-             arrayContainsAny:(NSArray<id> *)values
-    NS_SWIFT_NAME(whereField(_:arrayContainsAny:));
+             arrayContainsAny:(NSArray<id> *)values NS_SWIFT_NAME(whereField(_:arrayContainsAny:));
 
 /**
  * Creates and returns a new `FIRQuery` with the additional filter that documents must contain
@@ -526,8 +525,7 @@ NS_SWIFT_NAME(Query)
  *
  * @return The created `FIRQuery`.
  */
-- (FIRQuery *)queryEndingAtDocument:(FIRDocumentSnapshot *)document
-    NS_SWIFT_NAME(end(atDocument:));
+- (FIRQuery *)queryEndingAtDocument:(FIRDocumentSnapshot *)document NS_SWIFT_NAME(end(atDocument:));
 
 /**
  * Creates and returns a new `FIRQuery` that ends at the provided fields relative to the order of

+ 1 - 1
README.md

@@ -165,7 +165,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@13
+brew install clang-format@14
 brew install mint
 ```
 

+ 1 - 1
scripts/setup_check.sh

@@ -35,7 +35,7 @@ fi
 
 # install clang-format
 brew update
-brew install clang-format@13
+brew install clang-format@14
 
 # 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
-  13)
+  14)
     ;;
   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 12."
+    echo "Please upgrade to clang-format version 14."
     echo "If it's installed via homebrew you can run:"
     echo "brew upgrade clang-format"
     exit 1