]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Make caching lint default
authorvrana <jakubv@fb.com>
Thu, 20 Dec 2012 19:35:50 +0000 (11:35 -0800)
committervrana <jakubv@fb.com>
Thu, 20 Dec 2012 20:16:19 +0000 (12:16 -0800)
Summary: I use it couple of weeks without troubles.

Test Plan:
Added debug output and:

  $ arc lint
  $ arc lint --cache 0

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T2036

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

src/workflow/ArcanistDiffWorkflow.php
src/workflow/ArcanistLintWorkflow.php

index 181dd145ed3f70288c779829046c9c580e5bd872..8278311d728b60707356b01d94b56733eb1bb06d 100644 (file)
@@ -372,7 +372,7 @@ EOTEXT
       ),
       'cache' => array(
         'param' => 'bool',
-        'help' => "0 to disable lint cache (default), 1 to enable.",
+        'help' => "0 to disable lint cache, 1 to enable (default).",
         'passthru' => array(
           'lint' => true,
         ),
index 78b92ddbade8c265af72d4c3bfa87224204ac300..22b2983134c3e1eee25ed422d48f713018679b33 100644 (file)
@@ -128,7 +128,7 @@ EOTEXT
       ),
       'cache' => array(
         'param' => 'bool',
-        'help' => "0 to disable cache (default), 1 to enable.",
+        'help' => "0 to disable cache, 1 to enable (default).",
       ),
       '*' => 'paths',
     );
@@ -169,6 +169,7 @@ EOTEXT
 
     $rev = $this->getArgument('rev');
     $paths = $this->getArgument('paths');
+    $use_cache = $this->getArgument('cache', true);
 
     if ($rev && $paths) {
       throw new ArcanistUsageException("Specify either --rev or paths.");
@@ -198,7 +199,7 @@ EOTEXT
     $engine->setMinimumSeverity(
       $this->getArgument('severity', self::DEFAULT_SEVERITY));
 
-    if ($this->getArgument('cache')) {
+    if ($use_cache) {
       $cache = $this->readScratchJSONFile('lint-cache.json');
       $cache = idx($cache, $this->getCacheKey(), array());
       $cache = array_intersect_key($cache, array_flip($paths));
@@ -502,10 +503,10 @@ EOTEXT
 
     $cache = $this->readScratchJSONFile('lint-cache.json');
     $cached = idx($cache, $this->getCacheKey(), array());
-    if ($cached || $this->getArgument('cache')) {
+    if ($cached || $use_cache) {
       foreach ($results as $result) {
         $path = $result->getPath();
-        if (!$this->getArgument('cache')) {
+        if (!$use_cache) {
           unset($cached[$path]);
           continue;
         }