phpcbf is actually phpcs?
k1sul1 opened this issue · 1 comments
k1sul1 commented
Whilst developing Seravo/woo-pakettikauppa, I tried to use phpcbf in the dockerized version of this environment. I was wondering why the errors aren't getting fixed and why it just reported the errors instead, and the cause seems to be that phpcs & phpcbf are the same.
root@development:~/htdocs/wp-content/plugins/woo-pakettikauppa# which phpcs
/usr/local/bin/phpcs
root@development:~/htdocs/wp-content/plugins/woo-pakettikauppa# which phpcbf
/usr/local/bin/phpcbf
root@development:~/htdocs/wp-content/plugins/woo-pakettikauppa# cat /usr/local/bin/phpcbf
#!/usr/bin/env php
<?php
/**
* PHP_CodeSniffer detects violations of a defined coding standard.
*
* @author Greg Sherwood <gsherwood@squiz.net>
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
if (is_file(__DIR__.'/../autoload.php') === true) {
include_once __DIR__.'/../autoload.php';
} else {
include_once 'PHP/CodeSniffer/autoload.php';
}
$runner = new PHP_CodeSniffer\Runner();
$exitCode = $runner->runPHPCS();
exit($exitCode);
root@development:~/htdocs/wp-content/plugins/woo-pakettikauppa# cat /usr/local/bin/phpcs
#!/usr/bin/env php
<?php
/**
* PHP_CodeSniffer detects violations of a defined coding standard.
*
* @author Greg Sherwood <gsherwood@squiz.net>
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
if (is_file(__DIR__.'/../autoload.php') === true) {
include_once __DIR__.'/../autoload.php';
} else {
include_once 'PHP/CodeSniffer/autoload.php';
}
$runner = new PHP_CodeSniffer\Runner();
$exitCode = $runner->runPHPCS();
exit($exitCode);
root@development:~/htdocs/wp-content/plugins/woo-pakettikauppa#
In this case it doesn't matter since I was supposed to use a spesific version anyway (I just forgot to prefix the path), but this should probably get fixed anyway.
ottok commented
Thanks for noticing! This was a regression since January and is now fixed in latest Docker image.
vagrant@development:~$ phpcs --help
Usage: phpcs [-nwlsaepqvi] [-d key[=value]] [--colors] [--no-colors]
...
vagrant@development:~$ phpcbf --help
Usage: phpcbf [-nwli] [-d key[=value]] [--ignore-annotations] [--bootstrap=<bootstrap>]
...