]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Revert D2306
authorvrana <jakubv@fb.com>
Wed, 30 May 2012 22:14:22 +0000 (15:14 -0700)
committervrana <jakubv@fb.com>
Wed, 30 May 2012 22:20:25 +0000 (15:20 -0700)
Summary: We don't use this concept.

Test Plan:
  arc lint

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin
Maniphest Tasks: T1103

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

src/lint/linter/phutilmodule/ArcanistPhutilModuleLinter.php

index 5539219a9f567a13f2c73ae8f00b29b6475c0024..b7f58d670e4835f96d47070950b863945d3928cd 100644 (file)
@@ -86,11 +86,6 @@ final class ArcanistPhutilModuleLinter extends ArcanistLinter {
     return $info['module'];
   }
 
-  private function isModuleStandalone($key) {
-    $info = $this->moduleInfo[$key];
-    return $info['standalone'];
-  }
-
   private function isPhutilLibraryMetadata($path) {
     $file = basename($path);
     return !strncmp('__phutil_library_', $file, strlen('__phutil_library_'));
@@ -135,16 +130,14 @@ final class ArcanistPhutilModuleLinter extends ArcanistLinter {
       if ($path == $library_root) {
         continue;
       }
-      $map = $bootloader->getLibraryMap($library_name);
       $module_name = Filesystem::readablePath($path, $library_root);
       $module_key = $library_name.':'.$module_name;
       if (empty($modules[$module_key])) {
         $modules[$module_key] = $module_key;
         $this->setModuleInfo($module_key, array(
-          'library'    => $library_name,
-          'root'       => $library_root,
-          'module'     => $module_name,
-          'standalone' => !empty($map['standalone']),
+          'library' => $library_name,
+          'root'    => $library_root,
+          'module'  => $module_name,
         ));
       }
     }
@@ -183,10 +176,6 @@ final class ArcanistPhutilModuleLinter extends ArcanistLinter {
     foreach ($requirements as $key => $requirement) {
       foreach ($requirement['messages'] as $message) {
         list($where, $text, $code, $description) = $message;
-        if ($this->isModuleStandalone($key) &&
-            $code == self::LINT_ANALYZER_NO_INIT) {
-          continue;
-        }
         if ($where) {
           $where = array($where);
         }
@@ -204,12 +193,10 @@ final class ArcanistPhutilModuleLinter extends ArcanistLinter {
         } else {
           list($library_name, $module_name) = explode(':', $req_module);
           $library_root = phutil_get_library_root($library_name);
-          $map = PhutilBootloader::getInstance()->getLibraryMap($library_name);
           $this->setModuleInfo($req_module, array(
-            'library'    => $library_name,
-            'root'       => $library_root,
-            'module'     => $module_name,
-            'standalone' => !empty($map['standalone']),
+            'library' => $library_name,
+            'root'    => $library_root,
+            'module'  => $module_name,
           ));
           $disk_path = $this->getModulePathOnDisk($req_module);
           if (Filesystem::pathExists($disk_path)) {
@@ -255,15 +242,13 @@ final class ArcanistPhutilModuleLinter extends ArcanistLinter {
           $name,
           $deps);
         if (!$declared) {
-          if (!$this->isModuleStandalone($key)) {
-            $module = $this->getModuleDisplayName($key);
-            $message = $this->raiseLintInModule(
-              $key,
-              $lint_code,
-              "Module '{$module}' uses {$type} '{$name}' but does not include ".
-              "any module which declares it.",
-              $places);
-          }
+          $module = $this->getModuleDisplayName($key);
+          $message = $this->raiseLintInModule(
+            $key,
+            $lint_code,
+            "Module '{$module}' uses {$type} '{$name}' but does not include ".
+            "any module which declares it.",
+            $places);
 
           if ($type == 'class' || $type == 'interface') {
             $loader = new PhutilSymbolLoader();
@@ -281,10 +266,8 @@ final class ArcanistPhutilModuleLinter extends ArcanistLinter {
                 $loaded = false;
               }
               if ($loaded) {
-                if (!$this->isModuleStandalone($key)) {
-                  $resolvable[] = $message;
-                  $need_classes[$name] = $class_spec;
-                }
+                $resolvable[] = $message;
+                $need_classes[$name] = $class_spec;
               } else {
                 if (empty($this->unknownClasses[$name])) {
                   $this->unknownClasses[$name] = true;
@@ -326,12 +309,8 @@ final class ArcanistPhutilModuleLinter extends ArcanistLinter {
                 $loaded = false;
               }
               if ($loaded) {
-                // TODO: Check if the function is loaded in
-                // __phutil_library_init__.php for standalone modules.
-                if (!$this->isModuleStandalone($key)) {
-                  $resolvable[] = $message;
-                  $need_functions[$name] = $func_spec;
-                }
+                $resolvable[] = $message;
+                $need_functions[$name] = $func_spec;
               } else {
                 if (empty($this->unknownFunctions[$name])) {
                   $this->unknownFunctions[$name] = true;
@@ -388,16 +367,14 @@ final class ArcanistPhutilModuleLinter extends ArcanistLinter {
       }
     }
 
-    if (!$this->isModuleStandalone($key)) {
-      foreach ($spec['declares']['source'] as $file => $ignored) {
-        if (empty($spec['requires']['source'][$file])) {
-          $module = $this->getModuleDisplayName($key);
-          $resolvable[] = $this->raiseLintInModule(
-            $key,
-            self::LINT_UNUSED_SOURCE,
-            "Module '{$module}' does not include source file '{$file}'.",
-            null);
-        }
+    foreach ($spec['declares']['source'] as $file => $ignored) {
+      if (empty($spec['requires']['source'][$file])) {
+        $module = $this->getModuleDisplayName($key);
+        $resolvable[] = $this->raiseLintInModule(
+          $key,
+          self::LINT_UNUSED_SOURCE,
+          "Module '{$module}' does not include source file '{$file}'.",
+          null);
       }
     }