-
Notifications
You must be signed in to change notification settings - Fork 34
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
Make validate asynchronous #271
Conversation
Please don't merge this until we have created the v4 branch. |
@@ -42,7 +42,7 @@ export type ValidationWrapper = { | |||
}; | |||
|
|||
export interface ValidateHelper { | |||
validate(validateOpts: ValidationWrapper): Promise<any>; | |||
validate(validateOpts: ValidationWrapper): Promise<boolean>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agubler @matt-gadd does this look like the interface we want? I was thinking about Promise<any>
but I can't think if we'd want to return anything other than true or false back from a validate call. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a boolean
result for validate fits
src/commands/validate.ts
Outdated
} catch (error) { | ||
logValidateFunctionFailed(error); | ||
noMismatches = false; | ||
return Promise.all( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this really hard to follow, do you think we could make it clearer? Also I don't think you want to await in the map
, as you just want to await
the resulting array, right?
5e2d24a
to
3f5c220
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable
Type: feature
The following has been addressed in the PR:
prettier
as per the readme code style guidelinesDescription:
At the moment validate expects a boolean return type but the ValidateHelper returns a Promise, meaning you can't use the helper in a command.
Resolves #272