Eddie Lebow 56e67c5811 Add python_[linter]_auto_pipenv options for python linters (fixes #1656)
When set to true, and the buffer is currently inside a pipenv,
GetExecutable will return "pipenv", which will trigger the existing
functionality to append the correct pipenv arguments to run each linter.

Defaults to false.

I was going to implement ale#python#PipenvPresent by invoking
`pipenv --venv` or `pipenv --where`, but it seemed to be abominably
slow, even to the point where the test suite wasn't even finishing
("Tried to run tests 3 times"). The diff is:

diff --git a/autoload/ale/python.vim b/autoload/ale/python.vim
index 7baae079..8c100d41 100644
--- a/autoload/ale/python.vim
+++ b/autoload/ale/python.vim
@@ -106,5 +106,9 @@ endfunction

" Detects whether a pipenv environment is present.
function! ale#python#PipenvPresent(buffer) abort
-    return findfile('Pipfile.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
+    let l:cd_string = ale#path#BufferCdString(a:buffer)
+    let l:output = systemlist(l:cd_string . 'pipenv --where')[0]
+    " `pipenv --where` returns the path to the dir containing the Pipfile
+    " if in a pipenv, or some error text otherwise.
+    return strpart(l:output, 0, 18) !=# "No Pipfile present"
 endfunction

Using vim's `findfile` is much faster, behaves correctly in the majority
of situations, and also works reliably when the `pipenv` command doesn't
exist.
2018-09-15 22:10:46 -04:00
..
2017-11-15 22:23:46 +00:00
2017-10-03 01:11:54 +09:00
2018-07-01 13:55:41 +01:00
2018-08-27 10:58:17 +09:00
2018-01-29 22:21:50 +01:00
2018-05-11 20:14:00 +02:00
2018-01-16 00:38:35 -05:00
2017-12-26 14:10:28 -06:00
2017-12-01 17:36:44 +00:00
2018-09-06 20:31:12 +01:00
2018-08-02 13:50:56 -07:00
2017-08-10 21:09:58 +01:00
2018-09-08 16:05:34 -04:00
2018-01-08 23:39:04 +08:00
2018-05-04 21:44:32 +02:00
2018-09-06 21:59:03 -04:00
2018-08-26 13:47:56 +02:00
2018-04-21 22:09:38 +09:00
2018-02-10 13:17:53 -06:00
2018-06-25 10:28:59 +02:00
2018-02-04 10:57:52 -08:00
2018-09-09 23:34:27 +02:00
2018-06-25 11:21:53 -04:00
2017-12-04 14:23:34 -03:00
2018-09-08 01:34:10 +02:00
2017-08-02 23:05:19 +01:00
2017-10-26 19:37:04 +01:00
2018-08-03 21:13:48 +01:00