]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Remove "commit hook mode" workarounds for ArcanistXHPASTLinter
authorJoshua Spence <josh@joshuaspence.com>
Thu, 21 May 2015 05:05:50 +0000 (15:05 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Thu, 21 May 2015 05:08:39 +0000 (15:08 +1000)
Summary: Ref T7674. `ArcanistXHPASTLinter` has some workarounds for running in "commit hook" mode (which has since been removed). This linter should always have a working copy.

Test Plan: `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7674

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

src/lint/linter/ArcanistXHPASTLinter.php

index eccf22c9bedb3e5eb89508683861fba1ea9ed06d..29939e9efaae6caa81901c54a4f5d535ab1e188c 100644 (file)
@@ -957,13 +957,11 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
 
   private function lintImplicitFallthrough(XHPASTNode $root) {
     $hook_obj = null;
-    $working_copy = $this->getEngine()->getWorkingCopy();
-    if ($working_copy) {
-      $hook_class = $this->switchhook;
-      if ($hook_class) {
-        $hook_obj = newv($hook_class, array());
-        assert_instances_of(array($hook_obj), 'ArcanistXHPASTLintSwitchHook');
-      }
+
+    $hook_class = $this->switchhook;
+    if ($hook_class) {
+      $hook_obj = newv($hook_class, array());
+      assert_instances_of(array($hook_obj), 'ArcanistXHPASTLintSwitchHook');
     }
 
     $switches = $root->selectDescendantsOfType('n_SWITCH');
@@ -2253,20 +2251,15 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
       }
     }
 
-    $engine = $this->getEngine();
-    $working_copy = $engine->getWorkingCopy();
-
-    if ($working_copy) {
-      // If a naming hook is configured, give it a chance to override the
-      // default results for all the symbol names.
-      $hook_class = $this->naminghook;
-      if ($hook_class) {
-        $hook_obj = newv($hook_class, array());
-        foreach ($names as $k => $name_attrs) {
-          list($type, $name, $token, $default) = $name_attrs;
-          $result = $hook_obj->lintSymbolName($type, $name, $default);
-          $names[$k][3] = $result;
-        }
+    // If a naming hook is configured, give it a chance to override the
+    // default results for all the symbol names.
+    $hook_class = $this->naminghook;
+    if ($hook_class) {
+      $hook_obj = newv($hook_class, array());
+      foreach ($names as $k => $name_attrs) {
+        list($type, $name, $token, $default) = $name_attrs;
+        $result = $hook_obj->lintSymbolName($type, $name, $default);
+        $names[$k][3] = $result;
       }
     }