You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plugin: only search root package when it has the phpcodesniffer-standard type (bug fix)
In the "olden days" of PHPCS 1.x, it was customary for projects to call their custom project ruleset `ruleset.xml` instead of `[.]phpcs.xml[.dist]`.
This could lead to a root package with such an _old-style_ PHPCS ruleset being registered as if it were a proper PHPCS external standard.
This was previously reported in issue 32.
The fix I'm proposing now, applies the same rules as for `vendor` installed standards to the root package, i.e.:
* Must have the `phpcodesniffer-standard` type set in the `composer.json` file AND
* Must have a `ruleset.xml` file.
Root packages which do not comply with _both_ these rules will no longer be considered for registration with PHPCS. This should also make the plugin slightly faster for those packages which do not have external standards, but do have the plugin installed.
Includes removing some dead code (condition which could never be `true`) which was loosely related to this.
Fixes 32
0 commit comments