Added options to disable lint and unit tests in diffusion
This commit is contained in:
@@ -242,6 +242,28 @@ final class PhabricatorDifferentialConfigOptions
|
||||
"Normally, inline comments in emails are shown with a file and ".
|
||||
"line but without any diff context. Enabling this option adds ".
|
||||
"diff context.")),
|
||||
$this->newOption('differential.use-lint-style-checker', 'bool', true)
|
||||
->setBoolOptions(
|
||||
array(
|
||||
pht('Lint style checker is enabled'),
|
||||
pht('Lint style checker is disabled'),
|
||||
))
|
||||
->setSummary(pht('Use lint style checker'))
|
||||
->setDescription(
|
||||
pht(
|
||||
'Enable or disable lint style checker applied on patches.'.
|
||||
'setting {{differential.differential.use-lint-style-checker}}.')),
|
||||
$this->newOption('differential.use-unit-tests', 'bool', true)
|
||||
->setBoolOptions(
|
||||
array(
|
||||
pht('Unit tests are enabled'),
|
||||
pht('Unit tests are disabled'),
|
||||
))
|
||||
->setSummary(pht('Use unit tests'))
|
||||
->setDescription(
|
||||
pht(
|
||||
'Enable or disable unit tests.'.
|
||||
'setting {{differential.differential.use-lint-style-checker}}.')),
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,7 @@ final class DifferentialLintFieldSpecification
|
||||
extends DifferentialFieldSpecification {
|
||||
|
||||
public function shouldAppearOnDiffView() {
|
||||
return true;
|
||||
return PhabricatorEnv::getEnvConfig('differential.use-lint-style-checker');
|
||||
}
|
||||
|
||||
public function renderLabelForDiffView() {
|
||||
@@ -16,7 +16,7 @@ final class DifferentialLintFieldSpecification
|
||||
}
|
||||
|
||||
public function shouldAppearOnRevisionView() {
|
||||
return true;
|
||||
return PhabricatorEnv::getEnvConfig('differential.use-lint-style-checker');
|
||||
}
|
||||
|
||||
public function renderLabelForRevisionView() {
|
||||
|
@@ -4,7 +4,7 @@ final class DifferentialUnitFieldSpecification
|
||||
extends DifferentialFieldSpecification {
|
||||
|
||||
public function shouldAppearOnDiffView() {
|
||||
return true;
|
||||
return PhabricatorEnv::getEnvConfig('differential.use-unit-tests');
|
||||
}
|
||||
|
||||
public function renderLabelForDiffView() {
|
||||
@@ -16,7 +16,7 @@ final class DifferentialUnitFieldSpecification
|
||||
}
|
||||
|
||||
public function shouldAppearOnRevisionView() {
|
||||
return true;
|
||||
return PhabricatorEnv::getEnvConfig('differential.use-unit-tests');
|
||||
}
|
||||
|
||||
public function renderLabelForRevisionView() {
|
||||
|
@@ -124,14 +124,22 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
||||
$class = null;
|
||||
}
|
||||
|
||||
$lint_attrs = array('class' => 'revhistory-star');
|
||||
$unit_attrs = array('class' => 'revhistory-star');
|
||||
if ($diff) {
|
||||
$lint = self::renderDiffLintStar($row['obj']);
|
||||
$unit = self::renderDiffUnitStar($row['obj']);
|
||||
$lint_attrs['title'] = self::getDiffLintMessage($diff);
|
||||
$unit_attrs['title'] = self::getDiffUnitMessage($diff);
|
||||
$base = $this->renderBaseRevision($diff);
|
||||
$use_lint = PhabricatorEnv::getEnvConfig(
|
||||
'differential.use-lint-style-checker');
|
||||
if ($use_lint) {
|
||||
$lint_attrs = array('class' => 'revhistory-star');
|
||||
$unit_attrs = array('class' => 'revhistory-star');
|
||||
if ($diff) {
|
||||
$lint = self::renderDiffLintStar($row['obj']);
|
||||
$unit = self::renderDiffUnitStar($row['obj']);
|
||||
$lint_attrs['title'] = self::getDiffLintMessage($diff);
|
||||
$unit_attrs['title'] = self::getDiffUnitMessage($diff);
|
||||
$base = $this->renderBaseRevision($diff);
|
||||
} else {
|
||||
$lint = null;
|
||||
$unit = null;
|
||||
$base = null;
|
||||
}
|
||||
} else {
|
||||
$lint = null;
|
||||
$unit = null;
|
||||
@@ -156,8 +164,8 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
||||
phutil_tag('td', array('class' => 'revhistory-base'), $base),
|
||||
phutil_tag('td', array('class' => 'revhistory-desc'), $desc),
|
||||
phutil_tag('td', array('class' => 'revhistory-age'), $age),
|
||||
phutil_tag('td', $lint_attrs, $lint),
|
||||
phutil_tag('td', $unit_attrs, $unit),
|
||||
$use_lint ? phutil_tag('td', $lint_attrs, $lint) : '',
|
||||
$use_lint ? phutil_tag('td', $unit_attrs, $unit) : '',
|
||||
phutil_tag('td', array('class' => 'revhistory-old'.$old_class), $old),
|
||||
phutil_tag('td', array('class' => 'revhistory-new'.$new_class), $new),
|
||||
));
|
||||
@@ -196,8 +204,8 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
||||
phutil_tag('th', array(), pht('Base')),
|
||||
phutil_tag('th', array(), pht('Description')),
|
||||
phutil_tag('th', array(), pht('Created')),
|
||||
phutil_tag('th', array(), pht('Lint')),
|
||||
phutil_tag('th', array(), pht('Unit')),
|
||||
$use_lint ? phutil_tag('th', array(), pht('Lint')) : '',
|
||||
$use_lint ? phutil_tag('th', array(), pht('Unit')) : '',
|
||||
)));
|
||||
|
||||
$content = hsprintf(
|
||||
|
Reference in New Issue
Block a user