Skip to content

Commit

Permalink
improvement: update format CI step to match local melos format (#8993)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Lyokone authored Jun 29, 2022
1 parent ffd3b01 commit 159def6
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 57 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
BasedOnStyle: Google
---
19 changes: 5 additions & 14 deletions .github/workflows/all_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,17 @@ jobs:
- name: 'Install Tools'
run: |
./.github/workflows/scripts/install-tools.sh
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
brew install swiftformat
- name: 'Bootstrap Workspace'
run: melos bootstrap
- name: 'Dart'
- name: 'Dart, Java and Objective-C '
run: |
melos exec -c 1 -- \
"flutter format ."
flutter pub global run flutter_plugin_tools format
./.github/workflows/scripts/validate-formatting.sh
- name: 'Objective-C'
- name: 'Swift'
if: ${{ success() || failure() }}
run: |
echo "$(clang-format --version)"
melos exec -c 4 --ignore="*platform_interface*" --ignore="*web*" --dir-exists="ios" -- \
find . -maxdepth 3 -name "*.h" -o -name "*.m" -print0 \| xargs -0 clang-format -i --style=Google --verbose
./.github/workflows/scripts/validate-formatting.sh
- name: 'Java'
if: ${{ success() || failure() }}
run: |
melos exec -c 4 --ignore="*platform_interface*" --ignore="*web*" --dir-exists="android" -- \
find . -maxdepth 12 -name "*.java" -print0 \| xargs -0 java -jar $HOME/google-java-format.jar --replace
swiftformat .
./.github/workflows/scripts/validate-formatting.sh
build_examples_dart:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scripts/install-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

flutter config --no-analytics
flutter pub global activate melos 2.4.0
flutter pub global activate flutter_plugin_tools
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
echo "$GITHUB_WORKSPACE/_flutter/.pub-cache/bin" >> $GITHUB_PATH
echo "$GITHUB_WORKSPACE/_flutter/bin/cache/dart-sdk/bin" >> $GITHUB_PATH
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
#import "messages.g.h"

@interface FLTFirebaseCorePlugin
: FLTFirebasePlugin <FlutterPlugin, FLTFirebasePlugin, FirebaseCoreHostApi,
FirebaseAppHostApi>
: FLTFirebasePlugin <FlutterPlugin, FLTFirebasePlugin, FirebaseCoreHostApi, FirebaseAppHostApi>
@end
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ typedef void (^FLTFirebaseMethodCallErrorBlock)(NSString *_Nullable code,
* registering callbacks.
*/
@required
- (NSDictionary *_Nonnull)pluginConstantsForFIRApp:
(FIRApp *_Nonnull)firebaseApp;
- (NSDictionary *_Nonnull)pluginConstantsForFIRApp:(FIRApp *_Nonnull)firebaseApp;

/**
* The Firebase library name of the plugin, used by
Expand Down Expand Up @@ -95,17 +94,15 @@ typedef void (^FLTFirebaseMethodCallErrorBlock)(NSString *_Nullable code,
* An interface represent a returned result from a Flutter Method Call.
*/
@interface FLTFirebaseMethodCallResult : NSObject
+ (instancetype _Nonnull)
createWithSuccess:(FLTFirebaseMethodCallSuccessBlock _Nonnull)successBlock
andErrorBlock:(FLTFirebaseMethodCallErrorBlock _Nonnull)errorBlock;
+ (instancetype _Nonnull)createWithSuccess:(FLTFirebaseMethodCallSuccessBlock _Nonnull)successBlock
andErrorBlock:(FLTFirebaseMethodCallErrorBlock _Nonnull)errorBlock;

/**
* Submit a result indicating a successful method call.
*
* E.g.: `result.success(nil);`
*/
@property(readonly, nonatomic)
FLTFirebaseMethodCallSuccessBlock _Nonnull success;
@property(readonly, nonatomic) FLTFirebaseMethodCallSuccessBlock _Nonnull success;

/**
* Submit a result indicating a failed method call.
Expand All @@ -131,8 +128,7 @@ typedef void (^FLTFirebaseMethodCallErrorBlock)(NSString *_Nullable code,
*/
+ (FlutterError *_Nonnull)createFlutterErrorFromCode:(NSString *_Nonnull)code
message:(NSString *_Nonnull)message
optionalDetails:
(NSDictionary *_Nullable)details
optionalDetails:(NSDictionary *_Nullable)details
andOptionalNSError:(NSError *_Nullable)error;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "FLTFirebasePlugin.h"
#import <Foundation/Foundation.h>
#import "FLTFirebasePlugin.h"

@interface FLTFirebasePluginRegistry : NSObject
/**
Expand Down Expand Up @@ -34,8 +34,7 @@
* @param firebaseApp FIRApp Firebase App instance these constants relate to.
* @return NSDictionary Dictionary of plugins and their constants.
*/
- (NSDictionary *_Nonnull)pluginConstantsForFIRApp:
(FIRApp *_Nonnull)firebaseApp;
- (NSDictionary *_Nonnull)pluginConstantsForFIRApp:(FIRApp *_Nonnull)firebaseApp;

/**
* Each FlutterFire plugin implementing this method are notified that
Expand Down
45 changes: 16 additions & 29 deletions packages/firebase_core/firebase_core/ios/Classes/messages.g.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,11 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithName:(NSString *)name
options:(PigeonFirebaseOptions *)options
isAutomaticDataCollectionEnabled:
(nullable NSNumber *)isAutomaticDataCollectionEnabled
pluginConstants:
(NSDictionary<NSString *, id> *)pluginConstants;
isAutomaticDataCollectionEnabled:(nullable NSNumber *)isAutomaticDataCollectionEnabled
pluginConstants:(NSDictionary<NSString *, id> *)pluginConstants;
@property(nonatomic, copy) NSString *name;
@property(nonatomic, strong) PigeonFirebaseOptions *options;
@property(nonatomic, strong, nullable)
NSNumber *isAutomaticDataCollectionEnabled;
@property(nonatomic, strong, nullable) NSNumber *isAutomaticDataCollectionEnabled;
@property(nonatomic, strong) NSDictionary<NSString *, id> *pluginConstants;
@end

Expand All @@ -68,39 +65,29 @@ NSObject<FlutterMessageCodec> *FirebaseCoreHostApiGetCodec(void);
initializeAppRequest:(PigeonFirebaseOptions *)initializeAppRequest
completion:(void (^)(PigeonInitializeResponse *_Nullable,
FlutterError *_Nullable))completion;
- (void)initializeCoreWithCompletion:
(void (^)(NSArray<PigeonInitializeResponse *> *_Nullable,
FlutterError *_Nullable))completion;
- (void)optionsFromResourceWithCompletion:
(void (^)(PigeonFirebaseOptions *_Nullable,
FlutterError *_Nullable))completion;
- (void)initializeCoreWithCompletion:(void (^)(NSArray<PigeonInitializeResponse *> *_Nullable,
FlutterError *_Nullable))completion;
- (void)optionsFromResourceWithCompletion:(void (^)(PigeonFirebaseOptions *_Nullable,
FlutterError *_Nullable))completion;
@end

extern void
FirebaseCoreHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
NSObject<FirebaseCoreHostApi> *_Nullable api);
extern void FirebaseCoreHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
NSObject<FirebaseCoreHostApi> *_Nullable api);

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

@protocol FirebaseAppHostApi
- (void)setAutomaticDataCollectionEnabledAppName:(NSString *)appName
enabled:(NSNumber *)enabled
completion:
(void (^)(FlutterError *_Nullable))
completion;
- (void)
setAutomaticResourceManagementEnabledAppName:(NSString *)appName
enabled:(NSNumber *)enabled
completion:
(void (^)(FlutterError *_Nullable))
completion;
- (void)deleteAppName:(NSString *)appName
completion:(void (^)(FlutterError *_Nullable))completion;
completion:(void (^)(FlutterError *_Nullable))completion;
- (void)setAutomaticResourceManagementEnabledAppName:(NSString *)appName
enabled:(NSNumber *)enabled
completion:(void (^)(FlutterError *_Nullable))completion;
- (void)deleteAppName:(NSString *)appName completion:(void (^)(FlutterError *_Nullable))completion;
@end

extern void
FirebaseAppHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
NSObject<FirebaseAppHostApi> *_Nullable api);
extern void FirebaseAppHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
NSObject<FirebaseAppHostApi> *_Nullable api);

NS_ASSUME_NONNULL_END

0 comments on commit 159def6

Please sign in to comment.