From f2620fb217741237e422ff5e102533922c723815 Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Thu, 27 Oct 2022 14:15:38 +0200 Subject: [PATCH 1/4] Format REAModule.mm --- ios/REAModule.mm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ios/REAModule.mm b/ios/REAModule.mm index 61d9c28b84c..a57c16bdb67 100644 --- a/ios/REAModule.mm +++ b/ios/REAModule.mm @@ -293,19 +293,21 @@ - (void)eventDispatcherWillDispatchEvent:(id)event [_nodesManager dispatchEvent:event]; } -- (void)startObserving { - hasListeners = YES; +- (void)startObserving +{ + hasListeners = YES; } -- (void)stopObserving { - hasListeners = NO; +- (void)stopObserving +{ + hasListeners = NO; } - (void)sendEventWithName:(NSString *)eventName body:(id)body { - if (hasListeners) { - [super sendEventWithName:eventName body:body]; - } + if (hasListeners) { + [super sendEventWithName:eventName body:body]; + } } @end From 7506d21e85f7a015600ce8d9789e74dfa63c7da6 Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Thu, 27 Oct 2022 15:59:43 +0200 Subject: [PATCH 2/4] foo --- ios/REAModule.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/REAModule.mm b/ios/REAModule.mm index a57c16bdb67..e7153fd1f54 100644 --- a/ios/REAModule.mm +++ b/ios/REAModule.mm @@ -305,9 +305,9 @@ - (void)stopObserving - (void)sendEventWithName:(NSString *)eventName body:(id)body { - if (hasListeners) { - [super sendEventWithName:eventName body:body]; - } + if (hasListeners) { + [super sendEventWithName:eventName body:body]; + } } @end From d38a9e9d5f33a8afabd3d1f030c99727073ac23f Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Thu, 27 Oct 2022 16:10:42 +0200 Subject: [PATCH 3/4] Check iOS files formatting on CI --- .github/workflows/validate-ios.yml | 8 ++++++-- package.json | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate-ios.yml b/.github/workflows/validate-ios.yml index 42d0ad3d19f..98b31da396d 100644 --- a/.github/workflows/validate-ios.yml +++ b/.github/workflows/validate-ios.yml @@ -7,10 +7,14 @@ on: paths: - '.github/workflows/validate-ios.yml' - 'ios/**' + - 'package.json' + - 'scripts/validate-ios.sh' pull_request: paths: - '.github/workflows/validate-ios.yml' - 'ios/**' + - 'package.json' + - 'scripts/validate-ios.sh' jobs: check: @@ -18,5 +22,5 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Check imports - run: ./scripts/validate-ios.sh + - name: Lint iOS + run: yarn lint:ios diff --git a/package.json b/package.json index 2f65e35cf52..d7707ee480f 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ "lint:docs": "cd docs && yarn lint && cd ..", "lint:java": "./android/gradlew -p android spotlessCheck -q", "lint:cpp": "./scripts/cpplint.sh", - "lint:ios": "./scripts/validate-ios.sh", + "lint:ios": "./scripts/validate-ios.sh && yarn format:ios --dry-run", "format": "yarn format:js && yarn format:java && yarn format:ios && yarn format:android && yarn format:common", "format:js": "prettier --write --list-different './src/'", "format:java": "node ./scripts/format-java.js", - "format:ios": "find ios/ -iname *.h -o -iname *.m -o -iname *.mm -o -iname *.cpp | xargs clang-format -i", + "format:ios": "find ios/ -iname *.h -o -iname *.m -o -iname *.mm -o -iname *.cpp | xargs clang-format -i --Werror", "format:android": "find android/src/ -iname *.h -o -iname *.cpp | xargs clang-format -i", "format:common": "find Common/ -iname *.h -o -iname *.cpp | xargs clang-format -i", "release": "npm login && release-it", From 6b879fe9254d69389a6437f019c19c6954d3ebed Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Thu, 27 Oct 2022 16:14:32 +0200 Subject: [PATCH 4/4] Format iOS --- ios/REAModule.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/REAModule.mm b/ios/REAModule.mm index e7153fd1f54..a57c16bdb67 100644 --- a/ios/REAModule.mm +++ b/ios/REAModule.mm @@ -305,9 +305,9 @@ - (void)stopObserving - (void)sendEventWithName:(NSString *)eventName body:(id)body { - if (hasListeners) { - [super sendEventWithName:eventName body:body]; - } + if (hasListeners) { + [super sendEventWithName:eventName body:body]; + } } @end