Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugin: only search root package when it has the `phpcodesniffer-stan…
…dard` 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
- Loading branch information