Re: [PHP_CodeSniffer] Alter specific sniff by extending a standard
| From: | roehr at zilleon dot com | Date: | Wed, 16 May 2007 08:47:17 +0000 |
| Subject: | Re: [PHP_CodeSniffer] Alter specific sniff by extending a standard | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-27310@lists.php.net to get a copy of this message | ||
>Hi Torsten,
>
>One feature missing from PHP_CodeSniffer's new coding standard class is
>the ability to exclude a sniff, so you'll have to specify the list of
>PEAR sniffs that you want to include and leave out the
>ControlSignatureSniff from the list.
>
>So you'll have your own standard directory, one sniff that replaces the
>PEAR ControlSignatureSniff, and a coding standard class that lists
>almost all the PEAR and Generic sniffs, minus the ones you don't want.
>Note that you'll need to include the same Generic sniffs that the PEAR
>standard does so your standard is complete.
>
>I'd encourage you to submit a feature request to allow you to do this
>more easily.
>
>Greg
Hi Greg,
thank's for your answer. I had already tried what you point out but the following doesn't
work for me.
These three ways should give me the same results, right?:
1. Use PEAR Standard
2. Create own standard that includes
'PEAR'
3. Create own standard that includes
'Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff',
'Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff',
'Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff',
'Generic/Sniffs/PHP/LowerCaseConstantSniff',
'Generic/Sniffs/PHP/DisallowShortOpenTagSniff',
'PEAR/Sniffs/Commenting',
'PEAR/Sniffs/ControlStructures',
'PEAR/Sniffs/Files',
'PEAR/Sniffs/Functions',
'PEAR/Sniffs/NamingConventions',
'PEAR/Sniffs/WhiteSpace'
(The generic sniffs that PEAR uses and all PEAR sniffs)
But the third way does not seem to include the same sniffs as option one and two because I get less
warnings/errors.
Any idea what's wrong with my setup?
Thanks and regards,
Torsten