Setting allowed_warnings and allowed_errors to 0 by default, -1 in zero config mode. Fixes #377

This commit is contained in:
Dan Cryer 2014-04-30 14:18:58 +01:00
parent 9f3e66a515
commit e7e8455887
3 changed files with 15 additions and 4 deletions

View file

@ -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
);
}
}
}

View file

@ -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'];

View file

@ -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'];