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

Expose reporter(s) & reportDir via package.json config? #156

Closed
jameswomack opened this issue Jan 26, 2016 · 9 comments
Closed

Expose reporter(s) & reportDir via package.json config? #156

jameswomack opened this issue Jan 26, 2016 · 9 comments

Comments

@jameswomack
Copy link

I'm interested in moving --reportDir=tests/output/coverage --reporter=html into the package.json "nyc" config object, but don't know if that's something anyone else would see as being valuable.

@bcoe
Copy link
Member

bcoe commented Jan 26, 2016

@jameswomack sounds like a great configuration option, no objection here 👍

@jamestalmage
Copy link
Member

For that matter, there should be 100% config parity between the CLI and the package.json config.

CLI should take priority, defaulting to the config (which in turn defaults to our set of "sensible" defaults).

@jameswomack
Copy link
Author

@jamestalmage That's what seems intuitive to me

@bcoe
Copy link
Member

bcoe commented Jan 26, 2016

[email protected] is slowly plodding along, this almost feels like something that could be handled by yargs eventually.

I like that both ava and yargs have moved towards using a prefix in the package.json for their config -- one could imagine a world where someone indicates that yargs should automatically parse this stanza and use it to override default settings.

@bcoe
Copy link
Member

bcoe commented Jan 26, 2016

... perhaps we could add this on the yargs 4.x branch, and I could start publishing a 4.x tag of yargs to npm?

@jamestalmage
Copy link
Member

perhaps we could add this on the yargs 4.x branch

👍 The only contentious discussion we had w/ regard to this behavior in AVA, was what to do with array based args (i.e. ava --require babel/register --require some-other-module). What do you do to the require array in package.json if a --require option is used?

My contention was that you blow the original array away, forcing them to rewrite all the --require tags if that is what they want (this is what we ended up doing).

The other suggestion was that we append to the existing array. I argued against this because then you are unable to remove items from the package.json array from the command line.

I think our decisions make sense for a --require and --reporter flags. I guess it's possible there's some option out there where appending would be desired. I'm not coming up with one though.

@sindresorhus
Copy link
Member

For that matter, there should be 100% config parity between the CLI and the package.json config.
CLI should take priority, defaulting to the config (which in turn defaults to our set of "sensible" defaults).

👍 That's been working very well for AVA and XO.

I think our decisions make sense for a --require and --reporter flags.

I too feel we made the right choice with that.

@lloydcotten
Copy link
Contributor

Just a note that any implementation done for these options, should also be done for the new --extension arg / config setting that is now implemented in pull request #163.

@bcoe bcoe closed this as completed in 0b45e56 Feb 20, 2016
novemberborn pushed a commit to novemberborn/nyc that referenced this issue Apr 4, 2016
@jeffijoe
Copy link

It seems this does not work for the --reporter option - the values in package.json always seem to win for me?

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

No branches or pull requests

6 participants