Bug #19693 [Csd]: exclude-patterns no longer work on specific messages

From: Date: Wed, 07 Nov 2012 03:35:59 +0000
Subject: Bug #19693 [Csd]: exclude-patterns no longer work on specific messages
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-9299@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19693&edit=1 ID: 19693 Updated by: gsherwood@squiz.net Reported By: pear at kennel17 dot co dot uk Summary: exclude-patterns no longer work on specific messages Status: Closed Type: Bug Package: PHP_CodeSniffer Operating System: All Package Version: 1.4.1 PHP Version: Irrelevant Assigned To: squiz Roadmap Versions: New Comment: Thanks for getting back to me. I should have said "standard way" instead of "best way". The severity setting was built to exclude messages and sniffs for all files while the exclude patterns were built to exclude messages and sniffs for a subset of files. So if any improvements (perhaps performance improvements) are ever added in the future for excluding messages/sniffs from all files, it is better to be using the method that was designed for that purpose, although I'll always make sure the other way is also supported. Hope that makes sense. Previous Comments: ------------------------------------------------------------------------ [2012-11-07 03:22:18] happydog <severity>0</severity> works fine, but glad to see you've fixed the other method too. Out of interest, why is the <severity> method 'best' - are they not equivalent? ------------------------------------------------------------------------ [2012-11-07 02:04:17] squiz -Status: Feedback +Status: Closed Fixed in github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/0181a097c94ab7b1a5c5a3fdb 2aab60c470fa483 ------------------------------------------------------------------------ [2012-11-07 02:02:38] squiz -Summary: exclude-pattern * no longer works +Summary: exclude-patterns no longer work on specific messages ------------------------------------------------------------------------ [2012-11-07 01:37:47] squiz -Status: Open +Status: Feedback -Assigned To: +Assigned To: squiz Yes, it should exclude all files, so I will look into it. But the best way of doing this is actually to use this: <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine"> <severity>0</severity> </rule> That drops the severity down to 0, which tells PHPCS to stop generating that message. Give that a go and let me know if it works. ------------------------------------------------------------------------ [2012-11-07 00:50:55] happydog Description: ------------ In 1.4.0 I had this instruction in my ruleset.xml: <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine"> <exclude-pattern>*</exclude-pattern> </rule> This successfully excluded the rule for all files. In 1.4.1, this no longer works, and the EndLine errors are reported. I tried adding type="relative" to the <exclude-pattern> tag, but this makes no difference. Expected result: ---------------- An exclude pattern of * should block all files, regardless of whether in 'absolute' or 'relative' mode. Actual result: -------------- It doesn't seem to work in either mode. ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19693&edit=1

« previous php.pear.bugs (#9299) next »