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

  ID: 20457
  Comment by: woody.gilk@gmail.com
  Reported By: woody dot gilk@gmail.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

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

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 5, '14 at 6:06p
activeDec 5, '14 at 7:56p
posts2
users2
websitepear.php.net

2 users in discussion

Woody Gilk: 1 post Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase