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

opts/command line args precedence over config is inconsistent #165

Closed
lloydcotten opened this issue Feb 11, 2016 · 2 comments
Closed

opts/command line args precedence over config is inconsistent #165

lloydcotten opened this issue Feb 11, 2016 · 2 comments

Comments

@lloydcotten
Copy link
Contributor

While doing pull request #163, I noticed that nyc will take config from package.json over command line args and/or opts passed into the NYC constructor for some cases, but will take opts over config for other values (namely cwd). See these lines:
https://github.com/bcoe/nyc/blob/master/index.js#L34
https://github.com/bcoe/nyc/blob/master/index.js#L64

I patterned the new extension config after the require config where config from package.json is preferred:
https://github.com/bcoe/nyc/blob/master/index.js#L54

To me (and @novemberborn seems to agree) this is not intuitive. The only way command line args or opts are used for these properties, is if no package.json config exists. If we switched it around, it would make testing a bit easier, and would be more intuitive for usage when mixing package.json config and command line usage.

@bcoe
Copy link
Member

bcoe commented Feb 11, 2016

@lloydcotten my plan is to moving to having yargs load the configuration:

#156

Command-line arguments will take precedence over package.json configuration when I make this change 👍 Mind adding a note to #156

@bcoe bcoe closed this as completed Feb 11, 2016
@lloydcotten
Copy link
Contributor Author

Sounds good.

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

2 participants