sirbrillig / phpcs-changed

🐘 Run phpcs on files and only report new warnings/errors compared to the previous version.
MIT License
31 stars 11 forks source link

Fix no-vendor-phpcs flag #92

Closed sirbrillig closed 1 year ago

sirbrillig commented 1 year ago

PHP's getopt function sets boolean options to false, which is counter-intuitive. When we parse options, we must take that into account. That was already done for other boolean options, but I made a mistake in https://github.com/sirbrillig/phpcs-changed/pull/81 and did not correctly set the --no-vendor-phpcs option.

This was hidden because the unit tests do not use getopt and instead create the options manually and I forgot to set the option to false.

In this PR I fix those tests and then fix the bug.

In researching this bug, I also found a bunch of other options in the tests that did not correctly set their flags to false, which I've also fixed (thankfully they did not uncover any additional bugs).