Update dev:check style to use php-cs-fixer (#12132)

* Update dev:check style to use php-cs-fixer

* dont override default paths

* Update .php_cs

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
This commit is contained in:
Tony Murray
2020-09-23 20:54:00 -05:00
committed by GitHub
parent 9ade71d20c
commit 93e43d09bc
5 changed files with 492 additions and 76 deletions

View File

@@ -204,22 +204,13 @@ class CiHelper
*/
public function checkStyle()
{
// Disabled in favor of styleci
echo "Style check disabled.\n";
return 0;
$cs_cmd = [
$this->checkPhpExec('phpcs'),
'-n',
'-p',
'--colors',
'--extensions=php',
'--standard=misc/phpcs_librenms.xml',
$this->checkPhpExec('php-cs-fixer'),
'fix',
'-v',
];
$files = $this->flags['full'] ? ['./'] : $this->changed['php'];
$files = $this->flags['full'] ? [] : $this->changed['php'];
$cs_cmd = array_merge($cs_cmd, $files);
return $this->execute('style', $cs_cmd);