Changeset View
Changeset View
Standalone View
Standalone View
arcanist/configuration/ArcanistBitcoinABCConfiguration.php
Show All 26 Lines | if ($command === 'land') { | ||||
* messages, not advice messages. | * messages, not advice messages. | ||||
* | * | ||||
* --amend-autofix: since arc land expects a clean worktree, try to avoid | * --amend-autofix: since arc land expects a clean worktree, try to avoid | ||||
* asking the user to git add the file and run arc land again. | * asking the user to git add the file and run arc land again. | ||||
*/ | */ | ||||
$lintWorkflow = $workflow->buildChildWorkflow( | $lintWorkflow = $workflow->buildChildWorkflow( | ||||
'lint', array('--severity', 'autofix', '--amend-autofixes')); | 'lint', array('--severity', 'autofix', '--amend-autofixes')); | ||||
try { | |||||
$lintResult = $lintWorkflow->run(); | $lintResult = $lintWorkflow->run(); | ||||
} catch (Exception $ex) { | |||||
/* | |||||
* The lint workflow will throw an exception if no path is lintable. | |||||
* Catch this exception and return no error (this is what is done when | |||||
* arc lint is run). | |||||
*/ | |||||
if ($ex instanceof ArcanistNoEffectException) { | |||||
return 0; | |||||
} | |||||
} | |||||
$lintMessages = $lintWorkflow->getUnresolvedMessages(); | $lintMessages = $lintWorkflow->getUnresolvedMessages(); | ||||
/* | /* | ||||
* Autofix messages return RESULT_OKAY, so check there is no remaining | * Autofix messages return RESULT_OKAY, so check there is no remaining | ||||
* unresolved message. | * unresolved message. | ||||
*/ | */ | ||||
if ($lintResult != ArcanistLintWorkflow::RESULT_OKAY || | if ($lintResult != ArcanistLintWorkflow::RESULT_OKAY || | ||||
!empty($lintMessages)) { | !empty($lintMessages)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht("Please fix the linter issues before landing.")); | pht("Please fix the linter issues before landing.")); | ||||
} | } | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
} | } |