mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-26 16:52:40 +01:00
Added paths to search for python linters
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
This commit is contained in:
parent
df04c79a90
commit
c49997a6e8
3 changed files with 11 additions and 4 deletions
|
@ -45,7 +45,7 @@ final class ArcanistPEP8Linter extends ArcanistLinter {
|
||||||
$bin = $working_copy->getConfig('lint.pep8.bin');
|
$bin = $working_copy->getConfig('lint.pep8.bin');
|
||||||
|
|
||||||
if ($bin === null && $prefix === null) {
|
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').
|
phutil_get_library_root('arcanist').
|
||||||
'/../externals/pep8/pep8.py');
|
'/../externals/pep8/pep8.py');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -35,7 +35,7 @@ final class ArcanistPyFlakesLinter extends ArcanistLinter {
|
||||||
|
|
||||||
// Default to just finding pyflakes in the users path
|
// Default to just finding pyflakes in the users path
|
||||||
$pyflakes_bin = 'pyflakes';
|
$pyflakes_bin = 'pyflakes';
|
||||||
$python_path = '';
|
$python_path = array();
|
||||||
|
|
||||||
// If a pyflakes path was specified, then just use that as the
|
// If a pyflakes path was specified, then just use that as the
|
||||||
// pyflakes binary and assume that the libraries will be imported
|
// pyflakes binary and assume that the libraries will be imported
|
||||||
|
@ -50,9 +50,13 @@ final class ArcanistPyFlakesLinter extends ArcanistLinter {
|
||||||
$pyflakes_bin = $pyflakes_path;
|
$pyflakes_bin = $pyflakes_path;
|
||||||
} else if ($pyflakes_prefix !== null) {
|
} else if ($pyflakes_prefix !== null) {
|
||||||
$pyflakes_bin = $pyflakes_prefix.'/bin/pyflakes';
|
$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();
|
$options = $this->getPyFlakesOptions();
|
||||||
|
|
||||||
$f = new ExecFuture(
|
$f = new ExecFuture(
|
||||||
|
|
|
@ -133,7 +133,10 @@ final class ArcanistPyLintLinter extends ArcanistLinter {
|
||||||
$python_path = array();
|
$python_path = array();
|
||||||
foreach ($prefixes as $prefix) {
|
foreach ($prefixes as $prefix) {
|
||||||
if ($prefix !== null) {
|
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/site-packages';
|
||||||
|
$python_path[] = $prefix.'/lib/python2.6/dist-packages';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue