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

[proposal] harmonize command line flags and config file(s) #1826

Closed
brendankenny opened this issue Mar 7, 2017 · 2 comments
Closed

[proposal] harmonize command line flags and config file(s) #1826

brendankenny opened this issue Mar 7, 2017 · 2 comments
Assignees

Comments

@brendankenny
Copy link
Member

We need to simplify how options are specified and how you can figure out what options an individual gatherer or audit will be affected by to help users and also (hopefully) help keep our code clearer.

A few steps in that direction I've been thinking about, mostly leaning toward eslint-style configuration:

  • have every flag on the command line also be able to be specified in the config
  • use the same names for CLI flags and options in the config
  • have some subset of these available per-pass where it makes sense (e.g. override throttling)
  • have a clear hierarchy over what value wins when set at different levels (see e.g. eslint's "complete configuration hierarchy", which goes inline (per-pass option for us?) > CLI flag > config file)
  • support some sort of --print-config which prints a very verbose output of exactly what will be run with the current options from the current location. This is the last safeguard so you can tell what really is going to happen when you run lighthouse both for these flags and for extendable configs added in feat: allow extension of default config #1731

The other side of the first bullet point is allowing every top-level config option to also be specified on the command line, which is something eslint allows. I'm not sure how helpful that really is in practice, but they do at least namespace the options behind e.g. eslint --rule 'quotes: [2, double]' so there isn't a total explosion of possible CLI flags

@patrickhulce
Copy link
Collaborator

patrickhulce commented Mar 7, 2017

I was about to add "All options are overridable from CLI" to my features in the doc when you made this 😄

@wardpeet
Copy link
Collaborator

wardpeet commented Mar 7, 2017

would you go for the same name as in cli or make is camelCase as what yargs does in code?
disable-storage-reset => disableStorageReset?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants