]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Use have/need data in ArcanistPhutilLibraryLinter
authorepriestley <git@epriestley.com>
Thu, 17 Jul 2014 21:34:59 +0000 (14:34 -0700)
committerepriestley <git@epriestley.com>
Thu, 17 Jul 2014 21:34:59 +0000 (14:34 -0700)
Summary: Ref T5640. In D9864, the data this linter pulls out of the map was changed, breaking "use of undeclared function" warnings.

Test Plan:
```
>>> Lint for src/future/FutureProxy.php:

   Error  (PHL1) Unknown Symbol
    Use of unknown function 'qqqqqq'. Common causes are:

      - Your libphutil/ is out of date.
        This is the most common cause.
        Update this copy of libphutil: /INSECURE/devtools/libphutil

      - Some other library is out of date.
        Update the library this symbol appears in.

      - This symbol is misspelled.
        Spell the symbol name correctly.
        Symbol name spelling is case-sensitive.

      - This symbol was added recently.
        Run `arc liberate` on the library it was added to.

      - This symbol is external. Use `@phutil-external-symbol`.
        Use `grep` to find usage examples of this directive.

    *** ALTHOUGH USUALLY EASY TO FIX, THIS IS A SERIOUS ERROR.
    *** THIS ERROR IS YOUR FAULT. YOU MUST RESOLVE IT.

              15       $this->setProxiedFuture($proxied);
              16     }
              17
    >>>       18     qqqqqq();
              19   }
              20
              21   public function setProxiedFuture(Future $proxied) {
```

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T5640

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

src/__phutil_library_map__.php
src/lint/linter/ArcanistPhutilLibraryLinter.php

index 2940fb2587986a28110895a0d78933c1fc6379b0..c21f06f5f40bb36575f93960363fbc62bd7d72d3 100644 (file)
@@ -2,13 +2,13 @@
 
 /**
  * This file is automatically generated. Use 'arc liberate' to rebuild it.
+ *
  * @generated
  * @phutil-library-version 2
  */
 phutil_register_library_map(array(
   '__library_version__' => 2,
-  'class' =>
-  array(
+  'class' => array(
     'ArcanistAliasWorkflow' => 'workflow/ArcanistAliasWorkflow.php',
     'ArcanistAmendWorkflow' => 'workflow/ArcanistAmendWorkflow.php',
     'ArcanistAnoidWorkflow' => 'workflow/ArcanistAnoidWorkflow.php',
@@ -208,11 +208,8 @@ phutil_register_library_map(array(
     'XUnitTestEngine' => 'unit/engine/XUnitTestEngine.php',
     'XUnitTestResultParserTestCase' => 'unit/engine/__tests__/XUnitTestResultParserTestCase.php',
   ),
-  'function' =>
-  array(
-  ),
-  'xmap' =>
-  array(
+  'function' => array(),
+  'xmap' => array(
     'ArcanistAliasWorkflow' => 'ArcanistBaseWorkflow',
     'ArcanistAmendWorkflow' => 'ArcanistBaseWorkflow',
     'ArcanistAnoidWorkflow' => 'ArcanistBaseWorkflow',
index c127eee5bd3fce20033938d5c653fe706237efa7..965d95db35b9feca32f6704ea3f5a6365c07d794 100644 (file)
@@ -66,7 +66,8 @@ final class ArcanistPhutilLibraryLinter extends ArcanistLinter {
       $root = phutil_get_library_root($lib);
 
       try {
-        $symbols[$lib] = id(new PhutilLibraryMapBuilder($root))->buildMap();
+        $symbols[$lib] = id(new PhutilLibraryMapBuilder($root))
+          ->buildFileSymbolMap();
       } catch (XHPASTSyntaxErrorException $ex) {
         // If the library contains a syntax error then there isn't much that we
         // can do.