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

Bug #20322 Display rules set to type=error even when suppressing warnings
Submitted: 2014-06-28 03:07 UTC
From: mccreaja Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.5.3)
PHP Version: 5.4.24 OS: OS X 10.9.3
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 35 - 25 = ?

 
 [2014-06-28 03:07 UTC] mccreaja (Jason McCreary)
Description: ------------ I set a Sniff to of type error when it's default type is a warning see attached annotated ruleset. When I run `phpcs` against this ruleset, it correctly reports the error as expected. However, when I set `-n` to suppress warnings it does not show this error. Test script: --------------- <?xml version="1.0"?> <ruleset name="Via"> <description>The VIA Studio PHP coding standard.</description> <!-- PSR2 base --> <rule ref="PSR2"/> <rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed"> <type>error</type> </rule> </ruleset> Expected result: ---------------- I expected it to still show the error as it is reported as an error. However, it does not when the -n option is passed.

Comments

 [2014-06-30 12:21 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fix committed to Github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/648c5a290cc707fb37b175df96 ea7ce7264bbba9