]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Added paths to search for python linters
authorJesse Mullan <jmullan@visi.com>
Sat, 26 Jan 2013 13:31:25 +0000 (05:31 -0800)
committerepriestley <git@epriestley.com>
Sat, 26 Jan 2013 13:32:26 +0000 (05:32 -0800)
Summary: Added paths to search for python linters

Test Plan: Linted in ubuntu

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T2414

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

src/lint/linter/ArcanistPEP8Linter.php
src/lint/linter/ArcanistPyFlakesLinter.php
src/lint/linter/ArcanistPyLintLinter.php

index bc644c63e3f768094bf53dc651bf8e19dffa4bc4..735cfcfd17f28c601f3cf7ef4f0557c8acb7860c 100644 (file)
@@ -45,7 +45,7 @@ final class ArcanistPEP8Linter extends ArcanistLinter {
     $bin = $working_copy->getConfig('lint.pep8.bin');
 
     if ($bin === null && $prefix === null) {
-      $bin = csprintf('/usr/bin/env python2.6 %s',
+      $bin = csprintf('/usr/bin/env python %s',
                phutil_get_library_root('arcanist').
                '/../externals/pep8/pep8.py');
     } else {
index 7f9bb842b4dbcc923db29c615fa2b5675f693970..3ae6cdc3d4f81fa20224d4a67e468caf974143b7 100644 (file)
@@ -35,7 +35,7 @@ final class ArcanistPyFlakesLinter extends ArcanistLinter {
 
     // Default to just finding pyflakes in the users path
     $pyflakes_bin = 'pyflakes';
-    $python_path = '';
+    $python_path = array();
 
     // If a pyflakes path was specified, then just use that as the
     // pyflakes binary and assume that the libraries will be imported
@@ -50,9 +50,13 @@ final class ArcanistPyFlakesLinter extends ArcanistLinter {
       $pyflakes_bin = $pyflakes_path;
     } else if ($pyflakes_prefix !== null) {
       $pyflakes_bin = $pyflakes_prefix.'/bin/pyflakes';
-      $python_path = $pyflakes_prefix.'/lib/python2.6/site-packages:';
+      $python_path[] = $pyflakes_prefix.'/lib/python2.7/site-packages';
+      $python_path[] = $pyflakes_prefix.'/lib/python2.7/dist-packages';
+      $python_path[] = $pyflakes_prefix.'/lib/python2.6/site-packages';
+      $python_path[] = $pyflakes_prefix.'/lib/python2.6/dist-packages';
     }
-
+    $python_path[] = '';
+    $python_path = implode(':', $python_path);
     $options = $this->getPyFlakesOptions();
 
     $f = new ExecFuture(
index 618014ad2c394a45d4d9138139cb6d0ca963effc..88b45c18673e8f18e000642d5feb0fc95a517917 100644 (file)
@@ -133,7 +133,10 @@ final class ArcanistPyLintLinter extends ArcanistLinter {
     $python_path = array();
     foreach ($prefixes as $prefix) {
       if ($prefix !== null) {
+        $python_path[] = $prefix.'/lib/python2.7/site-packages';
+        $python_path[] = $prefix.'/lib/python2.7/dist-packages';
         $python_path[] = $prefix.'/lib/python2.6/site-packages';
+        $python_path[] = $prefix.'/lib/python2.6/dist-packages';
       }
     }