microsoft / microsoft/lage

[RFC]: Ability to provide CLI params as config

Open
#664 0 comments 0 reactions 1 assignee View on GitHub

@kenotron is already working on this.

Since May 12, 2023.

dev design
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 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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.