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 ".
|
"Normally, inline comments in emails are shown with a file and ".
|
||||||
"line but without any diff context. Enabling this option adds ".
|
"line but without any diff context. Enabling this option adds ".
|
||||||
"diff context.")),
|
"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 {
|
extends DifferentialFieldSpecification {
|
||||||
|
|
||||||
public function shouldAppearOnDiffView() {
|
public function shouldAppearOnDiffView() {
|
||||||
return true;
|
return PhabricatorEnv::getEnvConfig('differential.use-lint-style-checker');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderLabelForDiffView() {
|
public function renderLabelForDiffView() {
|
||||||
@@ -16,7 +16,7 @@ final class DifferentialLintFieldSpecification
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function shouldAppearOnRevisionView() {
|
public function shouldAppearOnRevisionView() {
|
||||||
return true;
|
return PhabricatorEnv::getEnvConfig('differential.use-lint-style-checker');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderLabelForRevisionView() {
|
public function renderLabelForRevisionView() {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ final class DifferentialUnitFieldSpecification
|
|||||||
extends DifferentialFieldSpecification {
|
extends DifferentialFieldSpecification {
|
||||||
|
|
||||||
public function shouldAppearOnDiffView() {
|
public function shouldAppearOnDiffView() {
|
||||||
return true;
|
return PhabricatorEnv::getEnvConfig('differential.use-unit-tests');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderLabelForDiffView() {
|
public function renderLabelForDiffView() {
|
||||||
@@ -16,7 +16,7 @@ final class DifferentialUnitFieldSpecification
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function shouldAppearOnRevisionView() {
|
public function shouldAppearOnRevisionView() {
|
||||||
return true;
|
return PhabricatorEnv::getEnvConfig('differential.use-unit-tests');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderLabelForRevisionView() {
|
public function renderLabelForRevisionView() {
|
||||||
|
|||||||
@@ -124,14 +124,22 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||||||
$class = null;
|
$class = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$lint_attrs = array('class' => 'revhistory-star');
|
$use_lint = PhabricatorEnv::getEnvConfig(
|
||||||
$unit_attrs = array('class' => 'revhistory-star');
|
'differential.use-lint-style-checker');
|
||||||
if ($diff) {
|
if ($use_lint) {
|
||||||
$lint = self::renderDiffLintStar($row['obj']);
|
$lint_attrs = array('class' => 'revhistory-star');
|
||||||
$unit = self::renderDiffUnitStar($row['obj']);
|
$unit_attrs = array('class' => 'revhistory-star');
|
||||||
$lint_attrs['title'] = self::getDiffLintMessage($diff);
|
if ($diff) {
|
||||||
$unit_attrs['title'] = self::getDiffUnitMessage($diff);
|
$lint = self::renderDiffLintStar($row['obj']);
|
||||||
$base = $this->renderBaseRevision($diff);
|
$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 {
|
} else {
|
||||||
$lint = null;
|
$lint = null;
|
||||||
$unit = 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-base'), $base),
|
||||||
phutil_tag('td', array('class' => 'revhistory-desc'), $desc),
|
phutil_tag('td', array('class' => 'revhistory-desc'), $desc),
|
||||||
phutil_tag('td', array('class' => 'revhistory-age'), $age),
|
phutil_tag('td', array('class' => 'revhistory-age'), $age),
|
||||||
phutil_tag('td', $lint_attrs, $lint),
|
$use_lint ? phutil_tag('td', $lint_attrs, $lint) : '',
|
||||||
phutil_tag('td', $unit_attrs, $unit),
|
$use_lint ? phutil_tag('td', $unit_attrs, $unit) : '',
|
||||||
phutil_tag('td', array('class' => 'revhistory-old'.$old_class), $old),
|
phutil_tag('td', array('class' => 'revhistory-old'.$old_class), $old),
|
||||||
phutil_tag('td', array('class' => 'revhistory-new'.$new_class), $new),
|
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('Base')),
|
||||||
phutil_tag('th', array(), pht('Description')),
|
phutil_tag('th', array(), pht('Description')),
|
||||||
phutil_tag('th', array(), pht('Created')),
|
phutil_tag('th', array(), pht('Created')),
|
||||||
phutil_tag('th', array(), pht('Lint')),
|
$use_lint ? phutil_tag('th', array(), pht('Lint')) : '',
|
||||||
phutil_tag('th', array(), pht('Unit')),
|
$use_lint ? phutil_tag('th', array(), pht('Unit')) : '',
|
||||||
)));
|
)));
|
||||||
|
|
||||||
$content = hsprintf(
|
$content = hsprintf(
|
||||||
|
|||||||
Reference in New Issue
Block a user