Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint iOS on CI #3728

Merged
merged 4 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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