Skip to content

Commit 159def6

Browse files
authored
improvement: update format CI step to match local melos format (#8993)
* chores: update format CI step to match local melos format * chores: update format CI step to match local melos format * chores: update format CI step to match local melos format
1 parent ffd3b01 commit 159def6

File tree

7 files changed

+33
-57
lines changed

7 files changed

+33
-57
lines changed

.clang-format

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
BasedOnStyle: Google
3+
---

.github/workflows/all_plugins.yaml

+5-14
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,17 @@ jobs:
6363
- name: 'Install Tools'
6464
run: |
6565
./.github/workflows/scripts/install-tools.sh
66-
curl -sL https://github.com/google/google-java-format/releases/download/google-java-format-1.3/google-java-format-1.3-all-deps.jar -o $HOME/google-java-format.jar
66+
brew install swiftformat
6767
- name: 'Bootstrap Workspace'
6868
run: melos bootstrap
69-
- name: 'Dart'
69+
- name: 'Dart, Java and Objective-C '
7070
run: |
71-
melos exec -c 1 -- \
72-
"flutter format ."
71+
flutter pub global run flutter_plugin_tools format
7372
./.github/workflows/scripts/validate-formatting.sh
74-
- name: 'Objective-C'
73+
- name: 'Swift'
7574
if: ${{ success() || failure() }}
7675
run: |
77-
echo "$(clang-format --version)"
78-
melos exec -c 4 --ignore="*platform_interface*" --ignore="*web*" --dir-exists="ios" -- \
79-
find . -maxdepth 3 -name "*.h" -o -name "*.m" -print0 \| xargs -0 clang-format -i --style=Google --verbose
80-
./.github/workflows/scripts/validate-formatting.sh
81-
- name: 'Java'
82-
if: ${{ success() || failure() }}
83-
run: |
84-
melos exec -c 4 --ignore="*platform_interface*" --ignore="*web*" --dir-exists="android" -- \
85-
find . -maxdepth 12 -name "*.java" -print0 \| xargs -0 java -jar $HOME/google-java-format.jar --replace
76+
swiftformat .
8677
./.github/workflows/scripts/validate-formatting.sh
8778
8879
build_examples_dart:

.github/workflows/scripts/install-tools.sh

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
flutter config --no-analytics
44
flutter pub global activate melos 2.4.0
5+
flutter pub global activate flutter_plugin_tools
56
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
67
echo "$GITHUB_WORKSPACE/_flutter/.pub-cache/bin" >> $GITHUB_PATH
78
echo "$GITHUB_WORKSPACE/_flutter/bin/cache/dart-sdk/bin" >> $GITHUB_PATH

packages/firebase_core/firebase_core/ios/Classes/FLTFirebaseCorePlugin.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@
1313
#import "messages.g.h"
1414

1515
@interface FLTFirebaseCorePlugin
16-
: FLTFirebasePlugin <FlutterPlugin, FLTFirebasePlugin, FirebaseCoreHostApi,
17-
FirebaseAppHostApi>
16+
: FLTFirebasePlugin <FlutterPlugin, FLTFirebasePlugin, FirebaseCoreHostApi, FirebaseAppHostApi>
1817
@end

packages/firebase_core/firebase_core/ios/Classes/FLTFirebasePlugin.h

+5-9
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ typedef void (^FLTFirebaseMethodCallErrorBlock)(NSString *_Nullable code,
5757
* registering callbacks.
5858
*/
5959
@required
60-
- (NSDictionary *_Nonnull)pluginConstantsForFIRApp:
61-
(FIRApp *_Nonnull)firebaseApp;
60+
- (NSDictionary *_Nonnull)pluginConstantsForFIRApp:(FIRApp *_Nonnull)firebaseApp;
6261

6362
/**
6463
* The Firebase library name of the plugin, used by
@@ -95,17 +94,15 @@ typedef void (^FLTFirebaseMethodCallErrorBlock)(NSString *_Nullable code,
9594
* An interface represent a returned result from a Flutter Method Call.
9695
*/
9796
@interface FLTFirebaseMethodCallResult : NSObject
98-
+ (instancetype _Nonnull)
99-
createWithSuccess:(FLTFirebaseMethodCallSuccessBlock _Nonnull)successBlock
100-
andErrorBlock:(FLTFirebaseMethodCallErrorBlock _Nonnull)errorBlock;
97+
+ (instancetype _Nonnull)createWithSuccess:(FLTFirebaseMethodCallSuccessBlock _Nonnull)successBlock
98+
andErrorBlock:(FLTFirebaseMethodCallErrorBlock _Nonnull)errorBlock;
10199

102100
/**
103101
* Submit a result indicating a successful method call.
104102
*
105103
* E.g.: `result.success(nil);`
106104
*/
107-
@property(readonly, nonatomic)
108-
FLTFirebaseMethodCallSuccessBlock _Nonnull success;
105+
@property(readonly, nonatomic) FLTFirebaseMethodCallSuccessBlock _Nonnull success;
109106

110107
/**
111108
* Submit a result indicating a failed method call.
@@ -131,8 +128,7 @@ typedef void (^FLTFirebaseMethodCallErrorBlock)(NSString *_Nullable code,
131128
*/
132129
+ (FlutterError *_Nonnull)createFlutterErrorFromCode:(NSString *_Nonnull)code
133130
message:(NSString *_Nonnull)message
134-
optionalDetails:
135-
(NSDictionary *_Nullable)details
131+
optionalDetails:(NSDictionary *_Nullable)details
136132
andOptionalNSError:(NSError *_Nullable)error;
137133

138134
/**

packages/firebase_core/firebase_core/ios/Classes/FLTFirebasePluginRegistry.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#import "FLTFirebasePlugin.h"
65
#import <Foundation/Foundation.h>
6+
#import "FLTFirebasePlugin.h"
77

88
@interface FLTFirebasePluginRegistry : NSObject
99
/**
@@ -34,8 +34,7 @@
3434
* @param firebaseApp FIRApp Firebase App instance these constants relate to.
3535
* @return NSDictionary Dictionary of plugins and their constants.
3636
*/
37-
- (NSDictionary *_Nonnull)pluginConstantsForFIRApp:
38-
(FIRApp *_Nonnull)firebaseApp;
37+
- (NSDictionary *_Nonnull)pluginConstantsForFIRApp:(FIRApp *_Nonnull)firebaseApp;
3938

4039
/**
4140
* Each FlutterFire plugin implementing this method are notified that

packages/firebase_core/firebase_core/ios/Classes/messages.g.h

+16-29
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,11 @@ NS_ASSUME_NONNULL_BEGIN
4949
- (instancetype)init NS_UNAVAILABLE;
5050
+ (instancetype)makeWithName:(NSString *)name
5151
options:(PigeonFirebaseOptions *)options
52-
isAutomaticDataCollectionEnabled:
53-
(nullable NSNumber *)isAutomaticDataCollectionEnabled
54-
pluginConstants:
55-
(NSDictionary<NSString *, id> *)pluginConstants;
52+
isAutomaticDataCollectionEnabled:(nullable NSNumber *)isAutomaticDataCollectionEnabled
53+
pluginConstants:(NSDictionary<NSString *, id> *)pluginConstants;
5654
@property(nonatomic, copy) NSString *name;
5755
@property(nonatomic, strong) PigeonFirebaseOptions *options;
58-
@property(nonatomic, strong, nullable)
59-
NSNumber *isAutomaticDataCollectionEnabled;
56+
@property(nonatomic, strong, nullable) NSNumber *isAutomaticDataCollectionEnabled;
6057
@property(nonatomic, strong) NSDictionary<NSString *, id> *pluginConstants;
6158
@end
6259

@@ -68,39 +65,29 @@ NSObject<FlutterMessageCodec> *FirebaseCoreHostApiGetCodec(void);
6865
initializeAppRequest:(PigeonFirebaseOptions *)initializeAppRequest
6966
completion:(void (^)(PigeonInitializeResponse *_Nullable,
7067
FlutterError *_Nullable))completion;
71-
- (void)initializeCoreWithCompletion:
72-
(void (^)(NSArray<PigeonInitializeResponse *> *_Nullable,
73-
FlutterError *_Nullable))completion;
74-
- (void)optionsFromResourceWithCompletion:
75-
(void (^)(PigeonFirebaseOptions *_Nullable,
76-
FlutterError *_Nullable))completion;
68+
- (void)initializeCoreWithCompletion:(void (^)(NSArray<PigeonInitializeResponse *> *_Nullable,
69+
FlutterError *_Nullable))completion;
70+
- (void)optionsFromResourceWithCompletion:(void (^)(PigeonFirebaseOptions *_Nullable,
71+
FlutterError *_Nullable))completion;
7772
@end
7873

79-
extern void
80-
FirebaseCoreHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
81-
NSObject<FirebaseCoreHostApi> *_Nullable api);
74+
extern void FirebaseCoreHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
75+
NSObject<FirebaseCoreHostApi> *_Nullable api);
8276

8377
/// The codec used by FirebaseAppHostApi.
8478
NSObject<FlutterMessageCodec> *FirebaseAppHostApiGetCodec(void);
8579

8680
@protocol FirebaseAppHostApi
8781
- (void)setAutomaticDataCollectionEnabledAppName:(NSString *)appName
8882
enabled:(NSNumber *)enabled
89-
completion:
90-
(void (^)(FlutterError *_Nullable))
91-
completion;
92-
- (void)
93-
setAutomaticResourceManagementEnabledAppName:(NSString *)appName
94-
enabled:(NSNumber *)enabled
95-
completion:
96-
(void (^)(FlutterError *_Nullable))
97-
completion;
98-
- (void)deleteAppName:(NSString *)appName
99-
completion:(void (^)(FlutterError *_Nullable))completion;
83+
completion:(void (^)(FlutterError *_Nullable))completion;
84+
- (void)setAutomaticResourceManagementEnabledAppName:(NSString *)appName
85+
enabled:(NSNumber *)enabled
86+
completion:(void (^)(FlutterError *_Nullable))completion;
87+
- (void)deleteAppName:(NSString *)appName completion:(void (^)(FlutterError *_Nullable))completion;
10088
@end
10189

102-
extern void
103-
FirebaseAppHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
104-
NSObject<FirebaseAppHostApi> *_Nullable api);
90+
extern void FirebaseAppHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
91+
NSObject<FirebaseAppHostApi> *_Nullable api);
10592

10693
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)