From ff94d699feda745c482ca3792f65e8d42cf5e318 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 29 Mar 2012 13:21:10 -0700 Subject: [PATCH] Minor Arcanist fixes Summary: Addresses concerns in rARCefb8219196abf047f14b505959e54d078e1df6d3: - As I recall, the intent of "generateFile" was that these warnings would replace all the other warnings for that file, under the theory that if one warning caused regeneration of the file the other warnings were irrelevant. - However, this code never had any effect and I haven't seen any issues with the behavior. - So, just remove it. Addresses concerns in rARC070e963d1c26879e47eab19a2377e388c2f166c5: - Ran "arc liberate --all". Test Plan: Ran "arc lint" after removing an "__init__.php" with and without a "fixed" generateFile block, there was no behavioral change. So I just nuked it. Reviewers: vrana, btrahan Reviewed By: vrana CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D2049 --- .../linter/phutilmodule/ArcanistPhutilModuleLinter.php | 5 ++--- src/lint/message/ArcanistLintMessage.php | 10 ---------- src/lint/result/ArcanistLintResult.php | 8 +------- src/workflow/help/__init__.php | 1 + 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/lint/linter/phutilmodule/ArcanistPhutilModuleLinter.php b/src/lint/linter/phutilmodule/ArcanistPhutilModuleLinter.php index 71e3f785..730e5b27 100644 --- a/src/lint/linter/phutilmodule/ArcanistPhutilModuleLinter.php +++ b/src/lint/linter/phutilmodule/ArcanistPhutilModuleLinter.php @@ -398,10 +398,9 @@ final class ArcanistPhutilModuleLinter extends ArcanistLinter { $old_file, $new_file); $message->setDependentMessages($resolvable); - foreach ($resolvable as $message) { - $message->setObsolete(true); + foreach ($resolvable as $resolvable_message) { + $resolvable_message->setObsolete(true); } - $message->setGenerateFile(true); } } diff --git a/src/lint/message/ArcanistLintMessage.php b/src/lint/message/ArcanistLintMessage.php index 7ee90a4b..a5242051 100644 --- a/src/lint/message/ArcanistLintMessage.php +++ b/src/lint/message/ArcanistLintMessage.php @@ -33,7 +33,6 @@ final class ArcanistLintMessage { protected $originalText; protected $replacementText; protected $appliedToDisk; - protected $generateFile; protected $dependentMessages = array(); protected $obsolete; @@ -149,15 +148,6 @@ final class ArcanistLintMessage { return ($this->getLine() !== null); } - public function setGenerateFile($generate_file) { - $this->generateFile = $generate_file; - return $this; - } - - public function getGenerateFile() { - return $this->generateFile; - } - public function setObsolete($obsolete) { $this->obsolete = $obsolete; return $this; diff --git a/src/lint/result/ArcanistLintResult.php b/src/lint/result/ArcanistLintResult.php index 69fdad8b..61e0e2b9 100644 --- a/src/lint/result/ArcanistLintResult.php +++ b/src/lint/result/ArcanistLintResult.php @@ -1,7 +1,7 @@ getGenerateFile()) { - $messages = array( - $key => $message, - ); - break; - } } $map = array(); diff --git a/src/workflow/help/__init__.php b/src/workflow/help/__init__.php index a9193cab..1dc0e906 100644 --- a/src/workflow/help/__init__.php +++ b/src/workflow/help/__init__.php @@ -10,6 +10,7 @@ phutil_require_module('arcanist', 'exception/usage'); phutil_require_module('arcanist', 'workflow/base'); phutil_require_module('phutil', 'console'); +phutil_require_module('phutil', 'utils'); phutil_require_source('ArcanistHelpWorkflow.php');