public function requiresRepositoryAPI() {
return true;
}
-
+
public function getDiffID() {
return $this->diffID;
}
foreach ($changes as $change) {
echo ' '.$change->renderTextSummary()."\n";
}
-
+
$this->diffID = $diff_info['diffid'];
return 0;
$argv[] = $repository_api->getRelativeCommit();
}
$lint_workflow = $this->buildChildWorkflow('lint', $argv);
- $lint_result = $lint_workflow->run();
+
+ $lint_workflow->setShouldAmendChanges(true);
+
+ $lint_result = $lint_workflow->run();
switch ($lint_result) {
case ArcanistLintWorkflow::RESULT_OKAY:
const RESULT_SKIP = 3;
private $unresolvedMessages;
+ private $shouldAmendChanges = false;
+
+ public function setShouldAmendChanges($should_amend) {
+ $this->shouldAmendChanges = $should_amend;
+ return $this;
+ }
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
}
}
- if ($wrote_to_disk && ($repository_api instanceof ArcanistGitAPI)) {
+ if ($wrote_to_disk &&
+ ($repository_api instanceof ArcanistGitAPI) &&
+ $this->shouldAmendChanges) {
$amend = phutil_console_confirm("Amend HEAD with lint patches?");
if ($amend) {
execx(
'(cd %s; git commit -a --amend -C HEAD)',
$repository_api->getPath());
} else {
- if ($this->getParentWorkflow()) {
- throw new ArcanistUsageException(
- "Sort out the lint changes that were applied to the working ".
- "copy and relint.");
- }
+ throw new ArcanistUsageException(
+ "Sort out the lint changes that were applied to the working ".
+ "copy and relint.");
}
}