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

nyc report html should maybe tell users that it’s not what they want? #401

Closed
addaleax opened this issue Sep 22, 2016 · 1 comment · Fixed by #1100
Closed

nyc report html should maybe tell users that it’s not what they want? #401

addaleax opened this issue Sep 22, 2016 · 1 comment · Fixed by #1100
Assignees

Comments

@addaleax
Copy link
Member

Okay, probably it’s just me having trained myself to use istanbul report over a long time, but I tend to always write nyc report html and am confused by the result that there is no actual HTML output.
I’ve begun to catch up always correcting to -r html, but maybe other people who transition to nyc would find it helpful if nyc report outputs a warning when it receives at least one positional argument?

What do you think?

@stale stale bot added the wontfix label Jan 6, 2019
@istanbuljs istanbuljs deleted a comment from stale bot Mar 7, 2019
@coreyfarrell
Copy link
Member

coreyfarrell commented Mar 7, 2019

@bcoe Adding .strict() to the report command builder fails with Unknown argument: exclude (I think due to the config in package.json). I removed global: false from the exclude option in config-util.js then added .hide('exclude') to the report command builder. This got around the unknown argument error, but then I didn't get any error for nyc report html. Is this a bug in yargs? The documentation for .strict() says Unrecognized commands will also be reported as errors. I was able to get the desired results by using .strict().demandCommand(0, 0).

I think I can make this work but it'll have to wait for some of the work from @AndrewFinlay to be merged. I'll try to get this into nyc@14 but I can't promise.

@coreyfarrell coreyfarrell self-assigned this Mar 7, 2019
@stale stale bot added the stale label May 6, 2019
@istanbuljs istanbuljs deleted a comment from stale bot May 6, 2019
@stale stale bot removed the stale label May 6, 2019
@stale stale bot removed the stale label May 6, 2019
coreyfarrell added a commit to coreyfarrell/nyc that referenced this issue 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 istanbuljs#401
coreyfarrell added a commit to coreyfarrell/nyc that referenced this issue May 9, 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 istanbuljs#401
coreyfarrell added a commit to coreyfarrell/nyc that referenced this issue May 9, 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 istanbuljs#401
coreyfarrell added a commit that referenced this issue May 9, 2019
…1100)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants