Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
Add cheppers/robo-phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
Andor Dávid committed Sep 5, 2016
1 parent 567a6da commit a55df19
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 5 deletions.
28 changes: 27 additions & 1 deletion RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class RoboFile extends \Robo\Tasks
// @codingStandardsIgnoreEnd
{
use \Cheppers\Robo\Phpcs\Task\LoadTasks;

/**
* @var array
Expand Down Expand Up @@ -60,6 +61,7 @@ public function githookPreCommit()

return $cb->addTaskList([
'lint.composer.lock' => $this->taskComposerValidate(),
'lint.phpcs.psr2' => $this->getTaskPhpcsLint(),
'codecept' => $this->getTaskCodecept(),
]);
}
Expand All @@ -75,7 +77,7 @@ public function test()
/**
* Run code style checkers.
*
* @return \Robo\Collection\Collection
* @return \Robo\Collection\CollectionBuilder
*/
public function lint()
{
Expand All @@ -84,6 +86,7 @@ public function lint()

return $cb->addTaskList([
'lint.composer.lock' => $this->taskComposerValidate(),
'lint.phpcs.psr2' => $this->getTaskPhpcsLint(),
]);
}

Expand All @@ -106,6 +109,29 @@ protected function initComposerInfo()
return $this;
}

/**
* @return \Cheppers\Robo\Phpcs\Task\TaskPhpcsLint
*/
protected function getTaskPhpcsLint()
{
return $this->taskPhpcsLint([
'colors' => 'always',
'standard' => 'PSR2',
'reports' => [
'full' => null,
'checkstyle' => 'tests/_output/checkstyle/phpcs-psr2.xml',
],
'files' => [
'src/',
'tests/_data/RoboFile.php',
'tests/_support/Helper/',
'tests/acceptance/',
'tests/unit/',
'RoboFile.php',
],
]);
}

/**
* @return \Robo\Task\Base\Exec
*/
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"description": "Robo task wrapper for tslint",
"license": "GPL-2.0+",
"config": {
"bin-dir": "bin"
"bin-dir": "bin",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand All @@ -13,6 +14,7 @@
},
"require-dev": {
"cheppers/git-hooks": "^0.0.8",
"cheppers/robo-phpcs": "^0.0.4",
"codeception/codeception": "^2.2",
"squizlabs/php_codesniffer": "2.6.2",
"symfony/process": "^2.8|^3.1"
Expand Down
39 changes: 37 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tests/_data/RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ public function lintWithJar()
->convertFormatTo('yaml2jsonGroupByFiles')
->paths(['samples/*']);
}

}
2 changes: 2 additions & 0 deletions tests/_support/Helper/Module/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ class Cli extends CodeceptionModule
*/
protected $stdError = null;

// @codingStandardsIgnoreStart
public function _cleanup()
{
// @codingStandardsIgnoreEnd
$this->process = null;
}

Expand Down

0 comments on commit a55df19

Please sign in to comment.