From 870e75eb64c8d5cd19dc381464345003cfa33ccf Mon Sep 17 00:00:00 2001 From: Andrej Radovic Date: Sat, 14 Jul 2018 13:24:46 +0200 Subject: Added the default local virtualenv name for Pipenv. Pipenv doesn't do local virtualenvs by default, it uses a special local directory to store them all. However, if you run Pipenv with the PIPENV_VENV_IN_PROJECT environment variable set to 1, it creates the virtual environment in the root of the project, under the name ".venv". This is why I've added this as a possible virtualenv dir name. --- autoload/ale/python.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'autoload') diff --git a/autoload/ale/python.vim b/autoload/ale/python.vim index cdc71cdd..7dc4a54c 100644 --- a/autoload/ale/python.vim +++ b/autoload/ale/python.vim @@ -6,6 +6,7 @@ let s:sep = has('win32') ? '\' : '/' let s:bin_dir = has('unix') ? 'bin' : 'Scripts' let g:ale_virtualenv_dir_names = get(g:, 'ale_virtualenv_dir_names', [ \ '.env', +\ '.venv', \ 'env', \ 've-py3', \ 've', -- cgit v1.2.3 From 976c048e6e1175ecd4a937926373c155c2e61c11 Mon Sep 17 00:00:00 2001 From: Andrej Radovic Date: Sat, 14 Jul 2018 13:26:50 +0200 Subject: Detect Python proj. roots by Pipfile "Pipfile" and "Pipfile.lock" files are also often located in Python module or package directories and their presence is an okay heuristic for finding project roots. --- autoload/ale/python.vim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'autoload') diff --git a/autoload/ale/python.vim b/autoload/ale/python.vim index 7dc4a54c..bc1cc980 100644 --- a/autoload/ale/python.vim +++ b/autoload/ale/python.vim @@ -24,6 +24,8 @@ function! ale#python#FindProjectRootIni(buffer) abort \|| filereadable(l:path . '/mypy.ini') \|| filereadable(l:path . '/pycodestyle.cfg') \|| filereadable(l:path . '/flake8.cfg') + \|| filereadable(l:path . '/Pipfile') + \|| filereadable(l:path . '/Pipfile.lock') return l:path endif endfor -- cgit v1.2.3