infection / infection

PHP Mutation Testing library
https://infection.github.io
BSD 3-Clause "New" or "Revised" License
2.05k stars 161 forks source link

If infection is given a directory instead of a file for its configuration, it should search that directory #859

Open Bilge opened 4 years ago

Bilge commented 4 years ago

In line with PHPUnit's behaviour, if the custom configuration file given is the path to a directory, rather than a path to a file, it should look for the same filenames it would by default, e.g. infection.json, infection.json.dist inside that directory instead of failing with an error because the directory itself is not a configuration file.

theofidry commented 4 years ago

The downside of that is that:

Bilge commented 4 years ago

I am suggesting to support directories in addition to files, not instead of. This invalidates your first two points. I cannot refute that supporting directories as well would increase code complexity but that's not a particularly valid point in my view.

theofidry commented 4 years ago

Maybe an easier way to approach this would be to allow to change the working directory like composer does:

$ composer --working-dir=/path/to/...