[RFC]: Ability to provide CLI params as config
@kenotron is already working on this.
Since May 12, 2023.
- Dominant language
- TypeScript
- Stars
- 816
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Description
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 linton my local I want to see the npmLog reporter - When I call
npm run linton my Azure DevOps Pipeline ( or manually withCI=true npm run lint) I should see output from the azureDevops reporter - When I call
npm run lint -- --reporter=jsonanywhere then I expect the report output to be in JSON format
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.