]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Minor change to `ArcanistPhutilLibraryLinter`
authorJoshua Spence <josh@joshuaspence.com>
Wed, 9 Jul 2014 21:38:40 +0000 (07:38 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Wed, 9 Jul 2014 21:38:40 +0000 (07:38 +1000)
Summary: Ref T5577. Modify `ArcanistPhutilLibraryLinter` to use `PhutilLibraryMapBuilder` instead of using an `ExecFuture` to run `phutil_rebuild_map.php`.

Test Plan: Ran `arc lint`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T5577

Differential Revision: https://secure.phabricator.com/D9864

src/lint/linter/ArcanistPhutilLibraryLinter.php

index d3972bf332ab9c9101a4a2916f0ba3c37dd78e0c..e6e1e4ce73e40caba81244373a25c80c2e078f83 100644 (file)
@@ -30,9 +30,9 @@ final class ArcanistPhutilLibraryLinter extends ArcanistLinter {
 
   public function getLintNameMap() {
     return array(
-      self::LINT_UNKNOWN_SYMBOL     => 'Unknown Symbol',
-      self::LINT_DUPLICATE_SYMBOL   => 'Duplicate Symbol',
-      self::LINT_ONE_CLASS_PER_FILE => 'One Class Per File',
+      self::LINT_UNKNOWN_SYMBOL     => pht('Unknown Symbol'),
+      self::LINT_DUPLICATE_SYMBOL   => pht('Duplicate Symbol'),
+      self::LINT_ONE_CLASS_PER_FILE => pht('One Class Per File'),
     );
   }
 
@@ -57,18 +57,10 @@ final class ArcanistPhutilLibraryLinter extends ArcanistLinter {
     // itself. This means lint results will accurately reflect the state of
     // the working copy.
 
-    $root = dirname(phutil_get_library_root('phutil'));
-    $bin = $root.'/scripts/phutil_rebuild_map.php';
-
     $symbols = array();
     foreach ($libs as $lib) {
-      // Do these one at a time since they individually fanout to saturate
-      // available system resources.
-      $future = new ExecFuture(
-        'php %s --show --quiet --ugly -- %s',
-        $bin,
-        phutil_get_library_root($lib));
-      $symbols[$lib] = $future->resolveJSON();
+      $root = phutil_get_library_root($lib);
+      $symbols[$lib] = id(new PhutilLibraryMapBuilder($root))->buildMap();
     }
 
     $all_symbols = array();