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

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)    

 [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"


 [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: 834d89e14f2c2