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

feat(validation): Add .skipValidation() method #471

Merged
merged 1 commit into from Apr 25, 2016

Conversation

elas7
Copy link
Member

@elas7 elas7 commented Apr 9, 2016

.skipValidation() takes a key. If the key is present, validation won't be performed.

Closes #453

`.skipValidation()` takes a key. If the key is present, validation won't be performed.

Closes yargs#453
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling a22b228 on elas7:skip-validation into a977ed7 on yargs:master.

argv.koala.should.equal(true)
})

it('allows key to be specified with option shorthand', function () {
Copy link
Member

Choose a reason for hiding this comment

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

it would be worthwhile to add one additional test that shows validation failing if one skipped argument is provided, but another argument is provided that causes it to still become a failure scenario.

@bcoe
Copy link
Member

bcoe commented Apr 10, 2016

@elas7 this seems great to me, is there a specific open-issue this addresses (for book keeping).

@plroebuck
Copy link

@bcoe, #453.

@bcoe bcoe merged commit d72badb into yargs:master Apr 25, 2016
@bcoe
Copy link
Member

bcoe commented Apr 25, 2016

@elas7 I appreciate that we can move helpOrVersion to a more generic name.

@nexdrew
Copy link
Member

nexdrew commented Apr 25, 2016

Sorry I have been delinquent in my reviews and am thus a little late to the game here. I don't really have a problem with .skipValidation(), but it's not the same as short-circuiting, which is what I thought the goal of #453 was.

If validation is skipped via special flag, execution just continues without an indication to the program of what scenario to run. Perhaps skipping validation is more flexible than short-circuit functionality, but I kinda thought executing a custom function and then exiting the process (per .exitProcess() setting) would be more helpful/popular than just skipping validation.

@bcoe @elas7 @plroebuck Thoughts?

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

Successfully merging this pull request may close these issues.

None yet

5 participants