Adding PHPCS report parsing.

This commit is contained in:
Dan Cryer 2014-04-30 14:15:25 +01:00
commit 2363775e34

View file

@ -151,6 +151,8 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
return false;
}
$this->phpci->logExecOutput(false);
$cmd = $phpcs . ' --report=json %s %s %s %s %s "%s"';
$this->phpci->executeCommand(
$cmd,
@ -165,6 +167,8 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
$output = $this->phpci->getLastOutput();
list($errors, $warnings, $data) = $this->processReport(json_decode(trim($output), true));
$this->phpci->logExecOutput(true);
$success = true;
$this->build->storeMeta('phpcs-warnings', $warnings);
$this->build->storeMeta('phpcs-errors', $errors);