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

Request #11738 Tab in col1 should be flagged as illegal
Submitted: 2007-08-02 07:51 UTC
From: mlavi Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 0.7.0)
PHP Version: 5.2.3 OS: linux-ia64
Roadmaps: (Not assigned)    
Subscription  


 [2007-08-02 07:51 UTC] mlavi (Mark Lavi)
Description: ------------ Quoting first sentence in this section: http://pear.php.net/manual/en/standards.php#standards.indenting "Use an indent of 4 spaces, with no tabs." Would it be possible to add a sniff for leading whitespace on a line that contains a tab and produce an error? This error (on my part) took a long time to track down in VIM. I've made an attempt to adapt your example hash mark disallowed sniff, but I'm not able to get it running yet. Sorry, I am new at this! :) Thanks, this is helping me finally standardize my code!

Comments

 [2007-08-02 22:37 UTC] squiz (Greg Sherwood)
Good idea. PHP_CodeSniffer's ScopeIndent sniff will treat tabs as a single space and throw errors, but a specific test for this would help explain the error more.
 [2007-08-02 23:19 UTC] squiz (Greg Sherwood)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. I've add a new generic sniff that can be used in coding standards. The PEAR and Squiz standards both use this new sniff.