| Newsgroups |
php.pear.bugs |
| Message-ID |
<[email protected]> |
Edit report at https://pear.php.net/bugs/bug.php?id=20551&edit=1
ID: 20551
Comment by: [email protected]
Reported By: jindrich dot kubat at mall dot cz
Summary: parameter --tab-width is not working
Status: Feedback
Type: Bug
Package: PHP_CodeSniffer
Operating System: CentOS
Package Version: 2.3.2
PHP Version: 5.5.13
Assigned To: squiz
Roadmap Versions:
New Comment:
Hi Greg,
yes your ruleset is working fine. Thank you for it. Maybe it would be
fine to write this link to the documentation in section --tab-width
https://pear.php.net/manual/en/package.php.php-codesniffer.advanced-usage.php
Thank you again
J.K
Previous Comments:
------------------------------------------------------------------------
[2015-05-19 01:08:53] squiz
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: squiz
The PSR2 standard enforces the use of spaces for indentation even if you
try and trick it by replacing
spaces with tabs. The indentation sniffs look at the content before tabs
are replaced.
If you want PSR2 with tabs instead of spaces, you'll need to use a
custom ruleset.xml file. I made one
here: https://gist.github.com/gsherwood/9d22f634c57f990a7c64
Does this work for you?
------------------------------------------------------------------------
[2015-05-18 09:54:17] jkubat
Description:
------------
Parameter --tab-width=4 with --standart=PSR2 is not working.
Simulation to test script:
phpcs --tab-width=4 --standard=PSR2 foo.php
Test script:
---------------
namespace foo;
class Foo
{
private $foo;
public function __construct($foo)
{
$this->foo = $foo;
}
private function bar()
{
}
}
Expected result:
----------------
No Errors: Spaces must be used to indent lines; tabs are not
| | allowed
Actual result:
--------------
7 Errors: Spaces must be used to indent lines; tabs are not
| | allowed
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20551&edit=1