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

Conversation

empyrical
Copy link
Contributor

This PR adds these two scripts to package.json:

  • flow-check-ios - for running flow check on .ios.js files
  • flow-check-android - for running flow check on .android.js files

The Android command makes use of the new --flowconfig-name option added to Flow in 0.80.0

Test Plan:

Both commands have been ran and work as expected.

Release Notes:

[GENERAL] [ENHANCEMENT] [package.json] - Added flow check commands for iOS and Android

@empyrical empyrical requested a review from hramos as a code owner September 26, 2018 01:22
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 26, 2018
@pull-bot
Copy link

Warnings
⚠️

🔒 package.json - Changes were made to package.json. This will require a manual import by a Facebook employee.

Generated by 🚫 dangerJS

@elicwhite
Copy link
Member

I believe we have commands that run in circle CI that check flow for both ios and android. Can you update the config to use these commands?

@empyrical
Copy link
Contributor Author

Added!

@@ -187,7 +187,8 @@ aliases:

- &run-flow-checks
name: Check for errors in code using Flow
command: yarn flow check
command: yarn flow-check-ios
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.

@@ -187,7 +187,8 @@ aliases:

- &run-flow-checks
name: Check for errors in code using Flow
command: yarn flow check
command: yarn flow-check-ios
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.

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

@react-native-bot react-native-bot added Platform: iOS iOS applications. Platform: Android Android applications. Core Team labels Sep 26, 2018
Copy link
Contributor

@gengjiawen gengjiawen left a comment

Choose a reason for hiding this comment

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

Can you this to appveyor too ?

@empyrical
Copy link
Contributor Author

I don't know a whole lot about the AppVeyor syntax yet - would just adding more commands after npm test work?

@hramos
Copy link
Contributor

hramos commented Sep 26, 2018

Landing. The checks can be added to Appveyor's config on a separate PR.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Sep 26, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

@empyrical merged commit 99cacf4 into facebook:master.


Once this commit is added to a release, you will see the corresponding version tag below the description at 99cacf4. If the commit has a single master tag, it is not yet part of a release.

@facebook facebook locked as resolved and limited conversation to collaborators Sep 27, 2018
@react-native-bot react-native-bot added the Merged This PR has been merged. label Sep 27, 2018
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
…1326)

Summary:
This PR adds these two scripts to `package.json`:

 * `flow-check-ios` - for running `flow check` on `.ios.js` files
 * `flow-check-android` - for running `flow check` on `.android.js` files

The Android command makes use of the new `--flowconfig-name` option added to Flow in `0.80.0`
Pull Request resolved: facebook#21326

Differential Revision: D10055702

Pulled By: hramos

fbshipit-source-id: e647f8d2995da0a9bd6af242218819fd5745df63
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: Android Android applications. Platform: iOS iOS applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants