Changeset View
Changeset View
Standalone View
Standalone View
arcanist/configuration/BitcoinABCConfiguration.php
Show All 12 Lines | private function runLint($workflow, $options = array()) { | ||||
} | } | ||||
return $err; | return $err; | ||||
} | } | ||||
public function willRunWorkflow($command, ArcanistWorkflow $workflow) { | public function willRunWorkflow($command, ArcanistWorkflow $workflow) { | ||||
if ($command === 'diff' && !$workflow->getArgument('nolint')) { | if ($command === 'diff' && !$workflow->getArgument('nolint')) { | ||||
$err = $this->runLint($workflow); | $err = $this->runLint($workflow); | ||||
$config = $workflow->getConfigurationManager(); | |||||
$config->setRuntimeConfig('lint.engine', 'RunOnceLintEngine'); | |||||
$err |= $this->runLint($workflow); | |||||
if ($err != ArcanistLintWorkflow::RESULT_OKAY) { | if ($err != ArcanistLintWorkflow::RESULT_OKAY) { | ||||
$workflow->finalize(); | $workflow->finalize(); | ||||
exit($err); | exit($err); | ||||
} | } | ||||
/* | /* | ||||
* Set the configuration but don't run the linter, the diff workflow will | * Set the configuration but don't run the linter, the diff workflow will | ||||
* do it for us. | * do it for us. | ||||
*/ | */ | ||||
$config = $workflow->getConfigurationManager(); | |||||
$config->setRuntimeConfig('lint.engine', 'RunLastLintEngine'); | $config->setRuntimeConfig('lint.engine', 'RunLastLintEngine'); | ||||
} | } | ||||
} | } | ||||
public function didRunWorkflow($command, ArcanistWorkflow $workflow, $err) { | public function didRunWorkflow($command, ArcanistWorkflow $workflow, $err) { | ||||
if ($command === 'lint') { | if ($command === 'lint') { | ||||
$config = $workflow->getConfigurationManager(); | $config = $workflow->getConfigurationManager(); | ||||
$config->setRuntimeConfig('lint.engine', 'RunOnceLintEngine'); | |||||
$this->runLint($workflow); | |||||
$config->setRuntimeConfig('lint.engine', 'RunLastLintEngine'); | $config->setRuntimeConfig('lint.engine', 'RunLastLintEngine'); | ||||
$this->runLint($workflow); | $this->runLint($workflow); | ||||
} | } | ||||
} | } | ||||
} | } |