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

focus-check should accepts more than one file #4189

Closed
avaly opened this issue Jun 16, 2017 · 7 comments
Closed

focus-check should accepts more than one file #4189

avaly opened this issue Jun 16, 2017 · 7 comments

Comments

@avaly
Copy link

avaly commented Jun 16, 2017

flow focus-check allows to check a single file, which can be useful in some cases.

In other cases, it would be helpful to get focus-check to check all files received as arguments. For example, to use together with https://github.com/okonet/lint-staged and have only the staged files being checked.

This should be possible:

flow focus-check a.js b.js

Actual result:

flow: unexpected argument 'b.js'.
@yantakus
Copy link

Any updates on this? Would be great to have.

@jabacchetta
Copy link

jabacchetta commented Sep 8, 2017

Also interested in this. Jest has the flag --findRelatedTests which handles this perfectly. One potential lint-staged setup (with the proposed feature) would look something along the lines of:

"lint-staged": {
    "*.js": [
      "eslint --fix --ignore-pattern '**/*.test.js'",
      "jest --bail --findRelatedTests",
      "flow related-check",
      "git add"
    ]
  }

Lint, run tests, and type-check before commits.

@KacperKozak
Copy link

Improved performance of flow focus-check for multiple files
https://github.com/facebook/flow/releases/tag/v0.56.0

I checked it out, it works.

@yantakus
Copy link

Can someone clarify how focus-check works? Didn't find any documentation on this command.

As I understand it checks all the dependencies of provided files and dependencies of dependencies. And as the result in my case when I provide any 2 files, it returns 850 errors (I have 859 errors in total).

Is there a way to still check all dependencies (I understand this is required) but display only errors found in provided files?

We want to fix all flow errors gradually with pre-commit hook, not all of them at once.

@sibelius
Copy link

can we filter the result of focus-check to only the selected files?

@julioxavierr
Copy link

Can we have an update about the question above?

@joelruns
Copy link

For further motivation of adding feature asked about in @sibelius post above, flow focus-check is needed for usage with arc lint or tools like pre-commit. If multiple files share a dependency, the output will be littered with duplicate errors, making things more difficult to parse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants