infection icon indicating copy to clipboard operation
infection copied to clipboard

Command line & configuration settings parity

Open BackEndTea opened this issue 6 years ago • 8 comments

Currently some options are only available through command line configuration.

It would be beneficial to allow all options for both configuration file and command line.

BackEndTea avatar Jan 30 '18 11:01 BackEndTea

I'm 👍 for striving to make Infection workable without any configuration. We can apply defaults and leverage command options to play with the config without the need of a config file to a certain degree.

However I'm a big 👎 to reach a full command option - config file equivalence. It's hard to do and requires a lot of work for (IMO) little benefits. Also we are likely to have more configuration entries in the future and as we add them it will become increasingly difficult to maintain an equivalence

theofidry avatar Jan 30 '18 11:01 theofidry

Currently some options are only available through command line configuration.

Is it still relevant @BackEndTea ?

If so, what concrete options you want to see in the config file?

It would be beneficial to allow all options for both configuration file and command line.

I'm not sure we need to do that. For example, configuring profiles, their ignore keys should not be in the command line. At least it's not convenient.

maks-rafalko avatar Aug 12 '18 20:08 maks-rafalko

I'd like to have just about all the options that you use through the cli in a config file.

For example, just about every time i run infection i add --threads=4. I might as well just put that in my config file.

But a few options that spring to mind would be

  • only-covered
  • threads
  • formatter
  • min-msi
  • min-covered-msi
  • log-verbosity

These would also make it easier to have some kind of infection-ci.json file somehwere, so for when running infection on ci the only flag to be passed would be --configuration=infection-ci.json

BackEndTea avatar Aug 19 '18 11:08 BackEndTea

#457 Adds the initialTestsPhpOptions and testFrameworkOptions options to the config file. Granted, I added them mostly out of trying to debug and add a redirect to the underlying run command, so they don't have to stay.

Fenikkusu avatar Aug 23 '18 00:08 Fenikkusu

As an aside, it makes sense to me to update command class such that it pulls everything from the config class, but the input class overrides the settings. IE:

$config = $this->getContainer()->get('config');
$config->override([
  'test-framework' => 'blah'
  //...
]);
$adapter = new adapter($config->getTestFramework);

Fenikkusu avatar Aug 23 '18 04:08 Fenikkusu

Revisiting the issue: it makes sense for a number of settings to be available both in the configuration & the command line. There is however some however, like the mutator's configuration settings, that should not IMO.

theofidry avatar Jul 24 '19 21:07 theofidry

Hi ! Is anyone making the change for only-covered ? If not I could take a look myself.

Neirda24 avatar Jan 18 '23 12:01 Neirda24

nobody is working on this AFAIK

maks-rafalko avatar Jan 18 '23 14:01 maks-rafalko