[PEAR-BUG] Bug #20457 [Com]: PHPCS no longer respects the --tab-width flag

[email protected] ("[email protected]") Fri, 5 Dec 2014 19:11:28 +0000 (GMT)
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at https://pear.php.net/bugs/bug.php?id=20457&edit=1

 ID:               20457
 Comment by:       [email protected]
 Reported By:      woody dot gilk at gmail dot com
 Summary:          PHPCS no longer respects the --tab-width flag
 Status:           Open
 Type:             Bug
 Package:          PHP_CodeSniffer
 Operating System: OSX
 Package Version:  2.0.0
 PHP Version:      5.5.19
 Roadmap Versions: 
 New Comment:

Confirmed that the same test script works correctly with phpcs v1.5.6


Previous Comments:
------------------------------------------------------------------------

[2014-12-05 19:04:57] shadowhand

Description:
------------
We use PSR2, but with tabs instead of spaces. After upgrading to 
PHPCS 2.0, the --tab-width=4 setting no longer works.

Reproduce with:

phpcs --standard=PSR2 --tab-width=4 Widget.php

Test script:
---------------
<?php

namespace Acme;

class Widget
{
	/**
	 * @return boolean
	 */
	public function shouldBeNoError()
	{
		return true;
	}
}


Expected result:
----------------
no output, no errors

Actual result:
--------------
FILE: Widget.php
--------------------------------------------------------------------------
------
FOUND 7 ERRORS AFFECTING 7 LINES
--------------------------------------------------------------------------
------
  7 | ERROR | [x] Spaces must be used to indent lines; tabs are 
not allowed
  8 | ERROR | [x] Spaces must be used to indent lines; tabs are 
not allowed
  9 | ERROR | [x] Spaces must be used to indent lines; tabs are 
not allowed
 10 | ERROR | [x] Spaces must be used to indent lines; tabs are 
not allowed
 11 | ERROR | [x] Spaces must be used to indent lines; tabs are 
not allowed
 12 | ERROR | [x] Spaces must be used to indent lines; tabs are 
not allowed
 13 | ERROR | [x] Spaces must be used to indent lines; tabs are 
not allowed
--------------------------------------------------------------------------
------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS 
AUTOMATICALLY
--------------------------------------------------------------------------
------

Time: 19ms; Memory: 3Mb

------------------------------------------------------------------------


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20457&edit=1