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

Bug #19811 Comments not ignored in all cases in AbstractPatternSniff
Submitted: 2013-02-06 07:30 UTC
From: erikwiffin Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.4.3)
PHP Version: 5.4.11 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2013-02-06 07:30 UTC] erikwiffin (Erik Wiffin)
Description: ------------ In AbstractPatternSniff, when checking to see if indents follow a newline, even if ignoreComments is true, if the previous token is a comment, an error will be reported. Test script: --------------- if (foo) { }// This comment will trigger an error else { } Expected result: ---------------- When matching against "}EOLelse {EOL", the comment should be ignored and the if block should validate. Actual result: -------------- ERROR | Expected "}\nelse {\n"; found "}// This comment will trigger an | error\n else {\n"

Comments

 [2013-02-06 07:34 UTC] erikwiffin (Erik Wiffin)
 [2013-05-21 12:11 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Thanks a lot for the patch and sorry for leaving it so long. Commit is here: https://github.com/squizlabs/PHP_CodeSniffer/commit/f93ca066ea7aff9bc4e4854837e 834d89e14f2c2