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

package.json: Add flow check commands for iOS and Android #21326

Closed
wants to merge 3 commits into from
Closed
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
13 changes: 9 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,13 @@ aliases:
name: Lint code
command: scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/react-native/reports/junit/eslint/results.xml

- &run-flow-checks
name: Check for errors in code using Flow
command: yarn flow check
- &run-flow-checks-ios
name: Check for errors in code using Flow (iOS)
command: yarn flow-check-ios

- &run-flow-checks-android
name: Check for errors in code using Flow (Android)
command: yarn flow-check-android
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah! We weren't checking this!? Scary!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why yarn run flow is not enough ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That only runs checking with the default config which checks .ios.js files but not .android.js files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the second command overwrites the first. Looking at the CI logs for this step in this PR show that it only ran flow on android: https://circleci.com/gh/facebook/react-native/53561?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

You'll probably need to change this from run-flow-checks to run-flow-ios and have another one for android.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed that up


- &run-sanity-checks
name: Sanity checks
Expand Down Expand Up @@ -377,7 +381,8 @@ jobs:
at: ~/react-native

- run: *run-lint-checks
- run: *run-flow-checks
- run: *run-flow-checks-ios
- run: *run-flow-checks-android

- store_test_results:
path: ~/react-native/reports/junit
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
"test": "jest",
"test-ci": "JEST_JUNIT_OUTPUT=\"reports/junit/js-test-results.xml\" jest --maxWorkers=2 --ci --testResultsProcessor=\"jest-junit\"",
"flow": "flow",
"flow-check-ios": "flow check",
"flow-check-android": "flow check --flowconfig-name .flowconfig.android",
"lint": "eslint .",
"prettier": "prettier \"./**/*.js\" --write",
"docker-setup-android": "docker pull reactnativeci/android-base:latest",
Expand Down