diff --git a/RoboFile.dist.ini b/RoboFile.dist.ini index bca9b6450d9..51c49af9e80 100644 --- a/RoboFile.dist.ini +++ b/RoboFile.dist.ini @@ -7,10 +7,10 @@ skipClone = false cmsPath = tests/joomla ; If you want to clone a different branch, you can set it here -branch = staging +branch = 4.1-dev ; (Linux / Mac only) If you want to set a different owner for the CMS root folder, you can set it here. localUser = www-data ; Set this to true, if your curl binaries are not able to create an https connection -insecure = false \ No newline at end of file +insecure = false diff --git a/RoboFile.php b/RoboFile.php index dd85b57017f..4fd2b3ea440 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -260,7 +260,7 @@ public function runTest($pathToTestFile = null, $suite = 'acceptance') } /** - * Run the specified checker tool. Valid options are phpmd, phpcs, phpcpd + * Run the specified checker tool. Valid options are phpmd, phpcs, phpcbf, phpcpd * * @param string $tool The tool * @@ -268,16 +268,18 @@ public function runTest($pathToTestFile = null, $suite = 'acceptance') */ public function runChecker($tool = null) { + $allowedTools = array('phpmd', 'phpcs', 'phpcbf','phpcpd'); + $allowedToolsString = implode(', ', $allowedTools); if ($tool === null) { - $this->say('You have to specify a tool name as argument. Valid tools are phpmd, phpcs, phpcpd.'); + $this->say(sprintf('You have to specify a tool name as argument. Valid tools are %s', $allowedToolsString)); return false; } - if (!in_array($tool, array('phpmd', 'phpcs', 'phpcpd'))) + if (!in_array($tool, $allowedTools)) { - $this->say('The tool you required is not known. Valid tools are phpmd, phpcs, phpcpd.'); + $this->say(sprintf('The tool you required is not known. Valid tools are %s', $allowedToolsString)); return false; } @@ -289,7 +291,10 @@ public function runChecker($tool = null) case 'phpcs': return $this->runPhpcs(); - + + case 'phpcbf': + return $this->runPhpcbf(); + case 'phpcpd': return $this->runPhpcpd(); } @@ -521,6 +526,16 @@ private function runPhpcs() $this->_exec('phpcs' . $this->extension . ' ' . __DIR__ . '/src'); } + /** + * Run the phpcbf tool + * + * @return void + */ + private function runPhpcbf() + { + $this->_exec('phpcbf --extensions=php' . $this->extension . ' ' . __DIR__ . '/src'); + } + /** * Run the phpcpd tool *