]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Include real PEP8 version and options in lint cache key
authorvrana <jakubv@fb.com>
Wed, 16 Jan 2013 20:10:17 +0000 (12:10 -0800)
committervrana <jakubv@fb.com>
Wed, 16 Jan 2013 20:17:11 +0000 (12:17 -0800)
Summary: This should be done for all external and configurable linters.

Test Plan: Linted file with lint problems, changed options, relinted.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4475

src/lint/engine/ArcanistLintEngine.php
src/lint/linter/ArcanistPEP8Linter.php

index 358ba281559e4bc93629a35190250d203d0c9733..80771c2bb8d9c8e0dab798412335421dda073f43 100644 (file)
@@ -185,6 +185,7 @@ abstract class ArcanistLintEngine {
 
     $versions = array($this->getCacheVersion());
     foreach ($linters as $linter) {
+      $linter->setEngine($this);
       $versions[] = get_class($linter).':'.$linter->getCacheVersion();
     }
     $this->cacheVersion = crc32(implode("\n", $versions));
@@ -196,7 +197,6 @@ abstract class ArcanistLintEngine {
         $linter_name = get_class($linter);
       }
       try {
-        $linter->setEngine($this);
         if (!$linter->canRun()) {
           continue;
         }
index c12b50f2586391bb4c42cba8a51a7d7c54ddf95b..bc644c63e3f768094bf53dc651bf8e19dffa4bc4 100644 (file)
@@ -24,7 +24,8 @@ final class ArcanistPEP8Linter extends ArcanistLinter {
   }
 
   public function getCacheVersion() {
-    return '1.3.4';
+    list($stdout) = execx('%C --version', $this->getPEP8Path());
+    return $stdout.$this->getPEP8Options();
   }
 
   public function getPEP8Options() {