fixed counting of errors and warnings in Plugin/PhpCodeSniffer;

use --report=emacs in Plugin/PhpCodeSniffer to not spam the logs with the full blown report but rather display a small human readable summary report
This commit is contained in:
Alexander Wenzel 2013-11-13 00:45:38 +01:00
commit 2fb162900d

View file

@ -120,7 +120,7 @@ class PhpCodeSniffer implements \PHPCI\Plugin
return false;
}
$cmd = $phpcs . ' %s %s %s %s %s "%s"';
$cmd = $phpcs . ' --report=emacs %s %s %s %s %s "%s"';
$success = $this->phpci->executeCommand(
$cmd,
$standard,
@ -134,12 +134,12 @@ class PhpCodeSniffer implements \PHPCI\Plugin
$output = $this->phpci->getLastOutput();
$matches = array();
if (preg_match_all('/WARNING/', $output, $matches)) {
if (preg_match_all('/\: warning \-/', $output, $matches)) {
$this->build->storeMeta('phpcs-warnings', count($matches[0]));
}
$matches = array();
if (preg_match_all('/ERROR/', $output, $matches)) {
if (preg_match_all('/\: error \-/', $output, $matches)) {
$this->build->storeMeta('phpcs-errors', count($matches[0]));
}