Conversation
|
I can confirm that this works in the setup of https://github.com/exercism/php |
|
@tomasnorre Thanks for testing and confirming! @williamdes Just checking if you've had the chance to test this PR as well ? I'd like to get this released ASAP, but would prefer to do this with confirmation from you that this fixes your problem too. |
Well, since I applied the standard way of things I no longer have this issue |
…ming conventions Sniff classes _should_ always follow the directory layout and naming conventions for sniffs as per the [Tutorial](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Coding-Standard-Tutorial). However, before the change made in 524, when given a sniff class name for a sniff not following the naming conventions, the `Common::getSniffCode()` method would return a "sniff code" anyway. And even though the sniff code would be unconventional and not really valid, it would still _work_. Since 524 this is no longer the case. Given the above, the change from 524 breaks custom rulesets which use `<rule>` includes for individual sniff files not complying with the naming conventions. Breaking changes can only be made in majors, so this commit reverts the problematic part of the change from 524. Includes additional tests safeguarding the (broken) behaviour which needs to be maintained until the next major. Fixes 675
|
@williamdes Thanks for getting back to me. In that case, I think I'll just go ahead and get this merged for release before the end of the week. I'll rebase the PR (without changes) now - as the CI setup has undergone some changes and some new required builds are missing. Once the build has passed, I'll get this merged. |
8e2190c to
71b4524
Compare
Description
Sniff classes should always follow the directory layout and naming conventions for sniffs as per the Tutorial.
However, before the change made in #524, when given a sniff class name for a sniff not following the naming conventions, the
Common::getSniffCode()method would return a "sniff code" anyway. And even though the sniff code would be unconventional and not really valid, it would still work.Since #524 this is no longer the case.
Given the above, the change from #524 breaks custom rulesets which use
<rule>includes for individual sniff files not complying with the naming conventions. Breaking changes can only be made in majors, so this commit reverts the problematic part of the change from #524.Includes additional tests safeguarding the (broken) behaviour which needs to be maintained (at least until the next major).
Suggested changelog entry
InvalidArgumentExceptionwhen a ruleset includes a sniff by file name and the included sniff does not comply with the PHPCS naming conventions.Related issues/external references
Fixes #675
Types of changes