store errors from parallel-lint as build_meta (key "phplint-errors");
add them to the "Quality Trend" graph on the build view
This commit is contained in:
parent
a0d5f4b4d8
commit
801cc8ee5e
2 changed files with 27 additions and 4 deletions
|
|
@ -25,6 +25,11 @@ class PhpParallelLint implements \PHPCI\Plugin
|
|||
*/
|
||||
protected $phpci;
|
||||
|
||||
/**
|
||||
* @var \PHPCI\Model\Build
|
||||
*/
|
||||
protected $build;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
|
@ -37,11 +42,15 @@ class PhpParallelLint implements \PHPCI\Plugin
|
|||
|
||||
public function __construct(Builder $phpci, Build $build, array $options = array())
|
||||
{
|
||||
$path = $phpci->buildPath;
|
||||
$this->phpci = $phpci;
|
||||
$this->directory = isset($options['directory']) ? $path . $options['directory'] : $path;
|
||||
$this->build = $build;
|
||||
$this->directory = $phpci->buildPath;
|
||||
$this->ignore = $this->phpci->ignore;
|
||||
|
||||
if (isset($options['directory'])) {
|
||||
$this->directory = $options['directory'];
|
||||
}
|
||||
|
||||
if (isset($options['ignore'])) {
|
||||
$this->ignore = $options['ignore'];
|
||||
}
|
||||
|
|
@ -68,6 +77,13 @@ class PhpParallelLint implements \PHPCI\Plugin
|
|||
$this->directory
|
||||
);
|
||||
|
||||
$output = $this->phpci->getLastOutput();
|
||||
|
||||
$matches = array();
|
||||
if (preg_match_all('/Parse error\:/', $output, $matches)) {
|
||||
$this->build->storeMeta('phplint-errors', count($matches[0]));
|
||||
}
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue