Skip to content

Commit a846af4

Browse files
authored
Merge pull request #19 from Cheppers/upgrade-robo
Upgrade consolidation/robo to 1.0.0-RC3
2 parents 020ee34 + 16abf6a commit a846af4

File tree

5 files changed

+416
-197
lines changed

5 files changed

+416
-197
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

2-
/fixtures/project-template/*/vendor/
32

3+
/bin/
4+
/fixtures/project-template/*/vendor/
45
/vendor/
56

67
/cheppers-git-hooks-*.tar

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ matrix:
1414
language: 'php'
1515
php: '7.0'
1616
env:
17-
- COMPOSER_NO_INTERACTION=1 COMPOSER_DISABLE_XDEBUG_WARN=1
17+
- 'COMPOSER_NO_INTERACTION=1 COMPOSER_DISABLE_XDEBUG_WARN=1'
1818
-
1919
os: 'osx'
2020
language: 'generic'
2121
env:
22-
- _PHP=php70 COMPOSER_NO_INTERACTION=1 COMPOSER_DISABLE_XDEBUG_WARN=1
22+
- '_PHP=php70 COMPOSER_NO_INTERACTION=1 COMPOSER_DISABLE_XDEBUG_WARN=1'
2323

2424
before_install:
2525
- 'src-dev/scripts/travis/before_install.sh'
@@ -28,5 +28,5 @@ install:
2828
- 'src-dev/scripts/travis/install.sh'
2929

3030
script:
31-
- './vendor/bin/robo lint'
32-
- './vendor/bin/robo test'
31+
- 'bin/robo lint'
32+
- 'bin/robo test'

RoboFile.php

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -75,74 +75,72 @@ public function __construct()
7575
}
7676
}
7777

78+
/**
79+
* @return null|\Robo\Task\Filesystem\FilesystemStack
80+
*/
7881
public function deployGitHooks()
7982
{
80-
$task = $this->getTaskDeployGitHooks();
81-
if ($task) {
82-
$task
83-
->run()
84-
->stopOnFail();
85-
}
83+
return $this->getTaskDeployGitHooks();
8684
}
8785

86+
/**
87+
* @return \Robo\Collection\CollectionBuilder
88+
*/
8889
public function test()
8990
{
90-
$this->stopOnFail();
91+
/** @var \Robo\Collection\CollectionBuilder $cb */
92+
$cb = $this->collectionBuilder();
9193

92-
/** @var \Robo\Collection\Collection $c */
93-
$c = $this->collection();
94-
$c
95-
->add($this->getTaskBehatRun())
96-
->run();
94+
return $cb
95+
->addTaskList([
96+
'test.behat' => $this->getTaskBehatRun(),
97+
]);
9798
}
9899

100+
/**
101+
* @return \Robo\Task\Base\Exec
102+
*/
99103
public function behat()
100104
{
101-
$this
102-
->getTaskBehatRun()
103-
->run()
104-
->stopOnFail();
105+
return $this->getTaskBehatRun();
105106
}
106107

108+
/**
109+
* @return \Robo\Task\Base\Exec
110+
*/
107111
public function composerValidate()
108112
{
109-
$this
110-
->getTaskComposerValidate()
111-
->run()
112-
->stopOnFail();
113+
return $this->getTaskComposerValidate();
113114
}
114115

116+
/**
117+
* @return \Robo\Collection\CollectionBuilder
118+
*/
115119
public function lint()
116120
{
117-
$this->stopOnFail();
118-
119-
/** @var \Robo\Collection\Collection $c */
120-
$c = $this->collection();
121-
$c
122-
->add($this->getTaskPhpcsLint())
123-
->add($this->getTaskComposerValidate())
124-
->run();
125-
}
121+
/** @var \Robo\Collection\CollectionBuilder $cb */
122+
$cb = $this->collectionBuilder();
126123

127-
public function lintPhpcs()
128-
{
129-
$this
130-
->getTaskPhpcsLint()
131-
->run()
132-
->stopOnFail();
124+
return $cb->addTaskList([
125+
'lint.composer.validate' => $this->getTaskComposerValidate(),
126+
'lint.phpcs.psr2' => $this->getTaskPhpcsLint(),
127+
]);
133128
}
134129

130+
/**
131+
* @return \Robo\Collection\CollectionBuilder
132+
*/
135133
public function githookPreCommit()
136134
{
137-
$this->lint();
135+
return $this->lint();
138136
}
139137

140138
/**
141139
* @return \Robo\Task\Base\Exec
142140
*/
143141
protected function getTaskPhpcsLint()
144142
{
145-
$cmd_pattern = '%s --standard=%s --ignore=%s %s %s %s %s';
143+
$cmd_pattern = '%s --colors --standard=%s --ignore=%s %s %s %s %s';
146144
$cmd_args = [
147145
escapeshellcmd("{$this->binDir}/phpcs"),
148146
escapeshellarg('PSR2'),

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
"name": "cheppers/git-hooks",
33
"description": "Provide a bridge between Git hooks and scripts under VCS.",
44
"license": "GPL-2.0",
5+
"config": {
6+
"bin-dir": "bin",
7+
"sort-packages": true
8+
},
59
"minimum-stability": "dev",
610
"prefer-stable": true,
711
"require": {},
812
"require-dev": {
913
"behat/behat": "~3.1",
10-
"consolidation/robo": "dev-master#6af485e",
14+
"consolidation/robo": "~1.0",
1115
"pear/archive_tar": "~1.4",
1216
"phpunit/phpunit": "~4.5",
1317
"squizlabs/php_codesniffer": "~2.6",

0 commit comments

Comments
 (0)