Skip to content

Commit

Permalink
Lint iOS on CI (#3728)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekzaw authored Oct 27, 2022
1 parent 0380104 commit 332ad9b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/validate-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ 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:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Check imports
run: ./scripts/validate-ios.sh
- name: Lint iOS
run: yarn lint:ios
16 changes: 9 additions & 7 deletions ios/REAModule.mm
Original file line number Diff line number Diff line change
Expand Up @@ -293,19 +293,21 @@ - (void)eventDispatcherWillDispatchEvent:(id<RCTEvent>)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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 332ad9b

Please sign in to comment.