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

[RFC]: Ability to provide CLI params as config #664

Open
drjonnicholson opened this issue May 12, 2023 · 0 comments
Open

[RFC]: Ability to provide CLI params as config #664

drjonnicholson opened this issue May 12, 2023 · 0 comments
Assignees

Comments

@drjonnicholson
Copy link

drjonnicholson commented May 12, 2023

Overview

Allow all parameters to be defined in the config file, allowing them to be dynamically defined, but still be overridden by the CLI.

Currently it looks like there are currently options that can only be passed through the CLI. For example, reporters appears to only take configuration from the CLI options.

Example use case

To be able to define reporters in the config, making use of javascript to help define values. Consider a lage.config.js like this where i've put reporter and grouped in the root as an example:

/** @type { import('lage').ConfigOptions } */
module.exports = {
  reporter: process.env.CI ? 'azureDevops' : 'npmLog',
  grouped: true,
  pipeline: {
    build: ['^build'],
    test: ['build'],
    lint: ['build']
  }
}

With the package.json like:

{...,
  "scripts": {...,
    "lint": "lage lint"
  }
}

Then:

  • When I call npm run lint on my local I want to see the npmLog reporter
  • When I call npm run lint on my Azure DevOps Pipeline ( or manually with CI=true npm run lint) I should see output from the azureDevops reporter
  • When I call npm run lint -- --reporter=json anywhere then I expect the report output to be in JSON format
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

2 participants