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

fix(cli): Report error if unwanted positional arguments are received #1100

Merged
merged 1 commit into from May 9, 2019

Conversation

@coreyfarrell
Copy link
Member

commented May 6, 2019

This applies to check-coverage, instrument, merge and report. Passing
additional arguments will now cause the help script to be displayed and
an error exit code.

Unknown flags nyc report --unknown=1 are still not reported.
Reporting unknown flags would require additional work as
yargs.strict() causes unknown items from configuration to be reported,
including flags that are defined for the global command but not a
sub-command.

Fixes #401


Is this a breaking change? I lean towards no but can see the argument. Likely this will first be released to 15.0.0 anyways but I'm not sure if it should be noted under breaking changes in the changelog.

@coveralls

This comment has been minimized.

Copy link

commented May 6, 2019

Coverage Status

Coverage remained the same at 96.87% when pulling 364c742 on coreyfarrell:stricter-yargs into b3dfae8 on istanbuljs:master.

@JaKXz
JaKXz approved these changes May 9, 2019
Copy link
Member

left a comment

This looks great. One minor request in the test code, and also can we make the commit message fix(cli): .. for the changelog? :)

test/nyc-integration.js Show resolved Hide resolved

@coreyfarrell coreyfarrell force-pushed the coreyfarrell:stricter-yargs branch from fc2a5b5 to c509e64 May 9, 2019

@coreyfarrell coreyfarrell changed the title fix: Report error if unwanted positional arguments are received fix(cli): Report error if unwanted positional arguments are received May 9, 2019

fix(cli): Report error if unwanted positional arguments are received
This applies to check-coverage, instrument, merge and report.  Passing
additional arguments will now cause the help script to be displayed and
an error exit code.

Unknown flags `nyc report --unknown=1` are still not reported.
Reporting unknown flags would require additional work as
`yargs.strict()` causes unknown items from configuration to be reported,
including flags that are defined for the global command but not a
sub-command.

Fixes #401

@coreyfarrell coreyfarrell force-pushed the coreyfarrell:stricter-yargs branch from c509e64 to 364c742 May 9, 2019

@coreyfarrell coreyfarrell merged commit 57debc1 into istanbuljs:master May 9, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 96.87%
Details

@coreyfarrell coreyfarrell deleted the coreyfarrell:stricter-yargs branch May 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.