diff --git a/PHPCI/Model/Build.php b/PHPCI/Model/Build.php index edd8fd2c..41fae705 100644 --- a/PHPCI/Model/Build.php +++ b/PHPCI/Model/Build.php @@ -150,7 +150,9 @@ class Build extends BuildBase foreach (array('setup', 'test', 'complete', 'success', 'failure') as $stage) { if ($className::canExecute($stage, $builder, $this)) { - $config[$stage][$className] = array(); + $config[$stage][$className] = array( + 'zero_config' => true + ); } } } diff --git a/PHPCI/Plugin/PhpCodeSniffer.php b/PHPCI/Plugin/PhpCodeSniffer.php index c88c422b..7c7f81e0 100755 --- a/PHPCI/Plugin/PhpCodeSniffer.php +++ b/PHPCI/Plugin/PhpCodeSniffer.php @@ -97,8 +97,13 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin $this->encoding = ''; $this->path = ''; $this->ignore = $this->phpci->ignore; - $this->allowed_warnings = -1; - $this->allowed_errors = -1; + $this->allowed_warnings = 0; + $this->allowed_errors = 0; + + if (isset($options['zero_config']) && $options['zero_config']) { + $this->allowed_warnings = -1; + $this->allowed_errors = -1; + } if (isset($options['suffixes'])) { $this->suffixes = (array)$options['suffixes']; diff --git a/PHPCI/Plugin/PhpMessDetector.php b/PHPCI/Plugin/PhpMessDetector.php index 7745c363..ce9f0193 100755 --- a/PHPCI/Plugin/PhpMessDetector.php +++ b/PHPCI/Plugin/PhpMessDetector.php @@ -71,7 +71,11 @@ class PhpMessDetector implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin $this->ignore = $phpci->ignore; $this->path = ''; $this->rules = array('codesize', 'unusedcode', 'naming'); - $this->allowed_warnings = -1; + $this->allowed_warnings = 0; + + if (isset($options['zero_config']) && $options['zero_config']) { + $this->allowed_warnings = -1; + } if (!empty($options['path'])) { $this->path = $options['path'];