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

Bug #19883 Single line comments must be ignored
Submitted: 2013-04-04 16:45 UTC
From: ton Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.4.5)
PHP Version: 5.4.12 OS: Debian 7
Roadmaps: (Not assigned)    
Subscription  


 [2013-04-04 16:45 UTC] ton (Ton Sharp)
Description: ------------ Comments which starts from the start of line must be ignored. Expected result: ---------------- function someFn() { // This one pass // This one pass too } Actual result: -------------- function someFn() { // This one pass // | ERROR | Line indented incorrectly; expected at least 4 spaces, found 0 }

Comments

 [2013-04-05 06:17 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Feedback -Assigned To: +Assigned To: squiz
Why must they be ignored?
 [2013-04-05 15:58 UTC] ton (Ton Sharp)
Do you relay think single line comments must be formatted as the rest of code? And why can't I comment whole line from the first symbol?
 [2013-04-05 16:16 UTC] squiz (Greg Sherwood)
-Status: Feedback +Status: Closed
It doesn't matter what I think. By default, PHPCS implements the PEAR standard. If you don't like the PEAR standard, there are several others that developers have written for use with PHPCS, or you can write your own custom ruleset.xml file or PHP sniffs. All standards included with PHPCS require comments to be indented to the same line as normal code, so I'm closing this report as PHPCS is working as intended. If you think that PHPCS is incorrectly implementing part of a documented standard, please re-open this report and I will look into it.