Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Request #19731 Unable to Exclude Directory of Sniffs
Submitted: 2012-12-05 22:21 UTC
From: chowarmaan Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.4.3)
PHP Version: 5.4.8 OS: Windows 7
Roadmaps: (Not assigned)    
Subscription  


 [2012-12-05 22:21 UTC] chowarmaan (Steven Scott)
Description: ------------ <?xml version="1.0"?> <ruleset name="ICAP Standards"> <description>ICAP Coding Standards</description> <rule ref="Generic"> <exclude name="Generic.VersionControl" /> </rule> </ruleset> Expected result: ---------------- As I do not want any of the sniffs in the directory, even though there is only one, I would expect that the complete directory would be ignored. Also, the Exclude Name should assume Generic, since that is the parent of this rule. It seems the parser is simply parsing without any knowledge of where it is. Actual result: -------------- PHP_CodeSniffer_Exception: Referenced sniff Generic.VersionControl does not exist in ....

Comments

 [2013-03-27 08:23 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Committed to github repo and will be released in 1.5.0RC2: https://github.com/squizlabs/PHP_CodeSniffer/commit/f172fa8abda3c378b786d5f6 9ac8890697c81b21 Some example uses: <!-- Include the Generic standard, but exclude version control sniffs --> <rule ref="Generic"> <exclude name="Generic.VersionControl" /> </rule> <!-- Include the Squiz standard, but exclude all sniffs from the Generic standard -- > <rule ref="Squiz"> <exclude name="PEAR" /> </rule>