infection
infection copied to clipboard
Command line & configuration settings parity
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.
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
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.
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
#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.
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);
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.
Hi ! Is anyone making the change for only-covered
? If not I could take a look myself.
nobody is working on this AFAIK