From 2fb162900d717c44bcd95c6eea11b8eae0729906 Mon Sep 17 00:00:00 2001 From: Alexander Wenzel Date: Wed, 13 Nov 2013 00:45:38 +0100 Subject: [PATCH] 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 --- PHPCI/Plugin/PhpCodeSniffer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PHPCI/Plugin/PhpCodeSniffer.php b/PHPCI/Plugin/PhpCodeSniffer.php index 44fa5893..2f0d7592 100755 --- a/PHPCI/Plugin/PhpCodeSniffer.php +++ b/PHPCI/Plugin/PhpCodeSniffer.php @@ -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])); }