- Notifications
You must be signed in to change notification settings - Fork22
Open
Description
It seems that when custom sniffs are present, everything in the ruleset will be ignored, including the custom sniffs themselves, and phpcodesniffer will just report everything as having passed.
Codeclimate cli version:0.71.1
My.codeclimate.yml
file
version:"2"plugins:phpcodesniffer:enabled:trueconfig:file_extensions:"php"standard:"./standards/phpcs/ruleset.xml"
And./standards/phpcs/ruleset.xml
<?xml version="1.0"?><rulesetname="MyStandard"> <description>Coding Standard.</description> <ruleref="PSR2"/></ruleset>
I then make some purposeful mistakes in some code that violate PSR2, and run
codeclimate analyze
It will correctly report the issues according to PSR2.
Now, when I add some custom Sniffs, just the mere presence of them will cause everything to pass.
For example, a completely empty sniff
<?phpnamespacePHP_CodeSniffer\Standards\MyStandard\Sniffs;usePHP_CodeSniffer\Sniffs\Sniff;usePHP_CodeSniffer\Files\File;class MyCustomSniffimplements Sniff{publicfunctionregister() {return []; }publicfunctionprocess(File$phpcsFile,$stackPtr) { }}
Now when
codeclimate analyze
is run, everything will report as passed, and the PSR2 enforcements are completely ignored.
Metadata
Metadata
Assignees
Labels
No labels