yeoman / doctor

Detect potential issues with users system that could prevent Yeoman from working correctly
http://yeoman.io
BSD 2-Clause "Simplified" License
61 stars 16 forks source link

Make every rules async #12

Closed SBoudrias closed 9 years ago

SBoudrias commented 9 years ago

Only supporting sync flow is pretty limiting (and not super future friendly). We should move to make every rule with a callback (even if they're not actually sync).

sindresorhus commented 9 years ago

:+1:

j3lte commented 9 years ago

Might this be a way? I have a pull request ready if you want : https://github.com/j3lte/doctor/commit/d82e2898243929299799911c2b6ab961a21f1c1e

SBoudrias commented 9 years ago

@j3lte It's a good start. We'll want to log each result lines as soon as they are ready. And there's some stylistic issue we'd discuss in a PR.

j3lte commented 9 years ago

Allright then I do not add the error in the callback, so async will complete all tasks... That way every line is logged.

As for the style... I would suggest keeping the arrays, but putting them all in a separate .js file. (That's just my personal taste, or do you rather put them in a textfile? If so, do you have an example in some library?)

SBoudrias commented 9 years ago

When the feature is ready, just send a PR. We'll discuss the rest over actual code.

SBoudrias commented 9 years ago

@j3lte Do you plan on sending a PR, I'd like to move forward with this!

j3lte commented 9 years ago

Stupid, I thought I already made a PR. This has both async, and templating in it. Will recreate the PR. I suggest pulling it into a feature branch and see what you can use...

PR

SBoudrias commented 9 years ago

Ok so now we need to:

  1. Progressively output each checks result
  2. Make each rules asynchronous for real (by that I mean taking a callback and calling it)