-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
If you put your custom standard in a directory called eg. php_coding_standard (which comes naturally because you probably already have node_modules and bower_components) you get silly sniff codes in your report (like php.standard.S.BraceOnSameLine in my case) which you cannot silence with
<rule ref="php.standard.S.BraceOnSameLine">
<severity>0</severity>
</rule>
see stack trace below.
If I name the directory "phpcs" all is well.
This restriction should at least be documented.
Warning: PHP Fatal error: Uncaught exception 'PHP_CodeSniffer_Exception' with message 'Referenced sniff "php.standard.S.BraceOnSameLine" does not exist' in /usr/share/php/PHP/CodeSniffer.php:1092
Stack trace:0 /usr/share/php/PHP/CodeSniffer.php(733): PHP_CodeSniffer->_expandRulesetReference(Object(SimpleXMLElement), '/home/...', 0)
1 /usr/share/php/PHP/CodeSniffer.php(551): PHP_CodeSniffer->processRuleset('/home/...')
2 /usr/share/php/PHP/CodeSniffer/CLI.php(818): PHP_CodeSniffer->initStandard(Array, Array)
3 /usr/share/php/PHP/CodeSniffer/CLI.php(95): PHP_CodeSniffer_CLI->process()
4 /usr/bin/phpcs(25): PHP_CodeSniffer_CLI->runphpcs()
5 {main}
thrown in /usr/share/php/PHP/CodeSniffer.php on line 1092
Metadata
Metadata
Assignees
Labels
No labels