This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
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 Fix #1216 - Suppress trailing whitespace warings for ansible-lint when the option is set 2017-12-13 11:14:31 +00:00
apiblueprint Improve ALE project style checking 2018-09-04 16:51:18 +01:00
asciidoc #1754 Require snake_case names for linters in the codebase 2018-07-24 10:05:44 +01:00
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 Make CloudFormation linter work again with latest 2018-06-20 14:59:51 +02:00
cmake Break shared handlers up into their own files, and fix stylelint error handling 2017-04-24 22:27:18 +01:00
coffee Ban use of ==# or ==? in the codebase, and prefer is# or is? instead 2017-08-08 08:39:13 +01:00
cpp Improve ALE project style checking 2018-09-04 16:51:18 +01:00
crystal #810 - Handle output which is not JSON in many linters 2017-07-27 00:45:25 +01:00
cs Massively reduce the amount of code needed for linter tests 2018-07-15 18:28:28 +01:00
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 Added "-wi" to the dmd command to endable warning messages. 2018-05-12 15:03:35 +09:00
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 Merge pull request #1157 from elebow/eruby-add-erubi-linter 2018-01-24 10:40:57 +00:00
fish Fix #1373 - Fix a bug with Fish errors not being handled on Linux 2018-03-23 12:17:54 +00:00
fortran Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
fountain Add four spaces, not tabs. 2017-12-20 22:53:03 -06:00
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 Add support for linting GraphQL with ESLint 2017-11-27 14:41:49 +00:00
hack Tell HHAST to only look at open files 2018-08-02 14:23:03 -07:00
haml Fix indentation for the haml-lint file 2017-10-25 23:07:38 +01:00
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 #1754 Require snake_case names for linters in the codebase 2018-07-24 10:05:44 +01:00
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 alex a file linter 2017-12-18 15:26:52 +01:00
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 #852 - Capture error codes for nimcheck 2017-11-19 00:38:00 +00:00
nix Add a function for getting matches, and use it to simplify a lot of code 2017-04-18 00:35:53 +01:00
nroff #1754 Require snake_case names for linters in the codebase 2018-07-24 10:05:44 +01:00
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 Close #542 - Add an option for disabling running locally installed executables by default 2018-04-09 19:11:20 +01:00
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 #1754 Require snake_case names for linters in the codebase 2018-07-24 10:05:44 +01:00
pod #1754 Require snake_case names for linters in the codebase 2018-07-24 10:05:44 +01:00
pony Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
proto Make it possible to inject flags of protoc invocation. 2018-01-07 17:56:56 +01:00
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 Use --vanilla switch for Rscript 2018-06-07 15:06:09 +02:00
reason Close #542 - Add an option for disabling running locally installed executables by default 2018-04-09 19:11:20 +01:00
review redpen support for asciidoc, reST, LaTeX and Re:VIEW 2017-11-17 15:34:07 +09:00
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 #852 - Capture error codes for slim-lint 2017-11-19 01:08:20 +00:00
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 Add a function for getting matches, and use it to simplify a lot of code 2017-04-18 00:35:53 +01:00
stylus Simplify the code for most linters and tests with closures 2018-08-02 23:44:12 +01:00
swift #852 - Capture error codes for swiftlint 2017-11-19 13:33:20 +00:00
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 Add support for dot-seperate linters, improve linter tests 2016-10-21 21:02:20 -05:00
tex Improve ALE project style checking 2018-09-04 16:51:18 +01:00
texinfo #1754 Require snake_case names for linters in the codebase 2018-07-24 10:05:44 +01:00
text #1754 Require snake_case names for linters in the codebase 2018-07-24 10:05:44 +01:00
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 Fix #1716 - Replace tempdir() with a wrapper to preserve TMPDIR 2018-07-12 13:05:59 +01:00
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 #1754 Require snake_case names for linters in the codebase 2018-07-24 10:05:44 +01:00
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