ale/ale_linters
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
..
ansible
apiblueprint Improve ALE project style checking 2018-09-04 16:51:18 +01:00
asciidoc
asm Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
awk Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
c Improve ALE project style checking 2018-09-04 16:51:18 +01:00
chef Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
clojure Improve ALE project style checking 2018-09-04 16:51:18 +01:00
cloudformation
cmake
coffee
cpp Improve ALE project style checking 2018-09-04 16:51:18 +01:00
crystal
cs
css Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
cucumber Improve ALE project style checking 2018-09-04 16:51:18 +01:00
cuda Improve ALE project style checking 2018-09-04 16:51:18 +01:00
d
dafny Improve ALE project style checking 2018-09-04 16:51:18 +01:00
dart Fix the dart language server command and cover it with tests 2018-09-04 11:15:59 +01:00
dockerfile Improve ALE project style checking 2018-09-04 16:51:18 +01:00
elixir Improve ALE project style checking 2018-09-04 16:51:18 +01:00
elm Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
erlang Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
eruby
fish
fortran Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
fountain
fuse Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
gitcommit gitcommit: fully implement warn_about_trailing_whitespace 2018-08-30 03:42:44 +02:00
glsl Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
go Change PCRE escape to simple escape 2018-09-14 10:41:35 +02:00
graphql
hack Tell HHAST to only look at open files 2018-08-02 14:23:03 -07:00
haml
handlebars Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
haskell Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
help
html Improve ALE project style checking 2018-09-04 16:51:18 +01:00
idris Improve ALE project style checking 2018-09-04 16:51:18 +01:00
java Improve ALE project style checking 2018-09-04 16:51:18 +01:00
javascript Improve ALE project style checking 2018-09-04 16:51:18 +01:00
json Improve ALE project style checking 2018-09-04 16:51:18 +01:00
julia Escape julia command + reorder table in README 2018-09-09 10:09:05 -04:00
kotlin Improve ALE project style checking 2018-09-04 16:51:18 +01:00
less Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
llvm Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
lua Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
mail
make Improve ALE project style checking 2018-09-04 16:51:18 +01:00
markdown Improve ALE project style checking 2018-09-04 16:51:18 +01:00
matlab Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
mercury Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
nasm Fixed NASM linter from outputting junk file 2018-09-10 08:17:44 +10:00
nim
nix
nroff
objc Improve ALE project style checking 2018-09-04 16:51:18 +01:00
objcpp Improve ALE project style checking 2018-09-04 16:51:18 +01:00
ocaml
perl Fix #1866 - Handle empty output from Perl 2018-09-06 09:23:36 +01:00
php Added and fixed tests 2018-08-18 20:59:35 +02:00
po
pod
pony Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
proto
pug Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
puppet Improve ALE project style checking 2018-09-04 16:51:18 +01:00
pyrex Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
python Add python_[linter]_auto_pipenv options for python linters (fixes #1656) 2018-09-15 22:10:46 -04:00
qml Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
r
reason
review
rst Improve ALE project style checking 2018-09-04 16:51:18 +01:00
ruby Fix bug with RuboCop linter when options are not set 2018-09-14 12:30:28 -04:00
rust Improve ALE project style checking 2018-09-04 16:51:18 +01:00
sass Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
scala Improve ALE project style checking 2018-09-04 16:51:18 +01:00
scss Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
sh Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
slim
sml Improve ALE project style checking 2018-09-04 16:51:18 +01:00
solidity Improve ALE project style checking 2018-09-04 16:51:18 +01:00
spec Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
sql
stylus Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
swift
tcl Improve ALE project style checking 2018-09-04 16:51:18 +01:00
terraform Improve ALE project style checking 2018-09-04 16:51:18 +01:00
testft
tex Improve ALE project style checking 2018-09-04 16:51:18 +01:00
texinfo
text
thrift Improve ALE project style checking 2018-09-04 16:51:18 +01:00
typescript Fix #1781 - Fix me breaking the tsserver linter 2018-08-03 17:22:09 +01:00
verilog
vim Improve ALE project style checking 2018-09-04 16:51:18 +01:00
vue Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
xhtml
xml Improve ALE project style checking 2018-09-04 16:51:18 +01:00
yaml Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
yang Improve ALE project style checking 2018-09-04 16:51:18 +01:00