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

Bug #12832 Tab to space conversion does not work
Submitted: 2008-01-05 07:46 UTC Modified: 2008-01-08 19:33 UTC
From: julian7 Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.0.0)
PHP Version: 5.2.5 OS:
Roadmaps: 1.0.1    
Subscription  


 [2008-01-05 07:46 UTC] julian7 (Balazs Nagy)
Description: ------------ Conversion from tabs to spaces before sniffs is documented in Advanced Usage manual. When I use the command shown in Example 55-5, I get this error: $ phpcs --tab-width=4 tmp/mainline/mvc/view.php ... 21 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 0 ... The aforementioned line in unambiguous form: samu:~>>% head -21 tmp/mainline/mvc/view.php | tail -1 | sed l \t * Selected view$ * Selected view

Comments

 [2008-01-05 08:15 UTC] squiz (Greg Sherwood)
Can you please provide a sample file to reproduce the error. The lines surrounding an error, and the file structure, are generally the cause of a bug and not the line itself.
 [2008-01-05 08:43 UTC] julian7 (Balazs Nagy)
Here's one (please use uuencoded version for testing): <?php /** * Test file * * @author Balazs Nagy <js@iksz.hu> */ /** * Test class */ class TestClass { /** * Constructor */ function __construct() { // do something } } ?> begin 644 test.php M/#]P:'`*"B\J*@H@*B!497-T(&9I;&4*("H@"B`J($!A=71H;W(@0F%L87IS M($YA9WD@/&IS0&EK<WHN:'4^"B`J+PH*+RHJ"B`J(%1E<W0@8VQA<W,*("HO M"F-L87-S(%1E<W1#;&%S<PI["@DO*BH*"2`J($-O;G-T<G5C=&]R"@D@*B\* M"69U;F-T:6]N(%]?8V]N<W1R=6-T*"D@>PH)"2\O(&1O('-O;65T:&EN9PH) '?0I]"C\^"@`` ` end samu:~>>% phpcs --tab-width=4 test.php FILE: /usr/home/admin/js/test.php -------------------------------------------------------------------------------- FOUND 12 ERROR(S) AND 1 WARNING(S) AFFECTING 5 LINE(S) -------------------------------------------------------------------------------- 7 | WARNING | PHP version not specified 7 | ERROR | Missing @category tag in file comment 7 | ERROR | Missing @package tag in file comment 7 | ERROR | Missing @license tag in file comment 7 | ERROR | Missing @link tag in file comment 11 | ERROR | Missing @category tag in class comment 11 | ERROR | Missing @package tag in class comment 11 | ERROR | Missing @author tag in class comment 11 | ERROR | Missing @license tag in class comment 11 | ERROR | Missing @link tag in class comment 15 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 0 16 | ERROR | Line indented incorrectly; expected at least 4 spaces, found 0 17 | ERROR | Opening function brace should be on a new line --------------------------------------------------------------------------------
 [2008-01-08 19:33 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.