Magento sniff codes do not match expected format (too many `.`)
convenient opened this issue · 1 comments
Preconditions
- Use any version of the magento coding standard
Steps to reproduce
- Try to use the
--excludeflag on the CLI to exclude a magento sniff
$ ./vendor/bin/phpcs -s --standard=Magento2 --exclude=Magento2.Annotation.MethodArguments.MethodArguments src
ERROR: The specified sniff code "Magento2.Annotation.MethodAnnotationStructure.MethodArguments" is invalid
Run "phpcs --help" for usage informationExpected result
- I can run
phpcswith the specified rule excluded
Actual result
I get an error from phpcs as it doesnt expect this many . in the sniff codes
squizlabs/php_codesniffer only expects 2 . within a rule name
--exclude=Magento2.Annotation.MethodArguments.MethodArguments has 3
When I hack out the check in vendor/squizlabs/php_codesniffer/src/Config.php it seems to exclude the rule okay so not sure why they're being strict there. But it still seems like the way the Magento rules are defined they're not fully compatible with squizlabs/php_codesniffer
Workaround
Define my own ruleset which excludes the rules i'm suppressing.
Hi @convenient. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.