diff options
author | Daniel Roseman <daniel@roseman.org.uk> | 2021-07-25 05:39:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-25 13:39:05 +0900 |
commit | 7d8fb2ba1716a744446b811fc278ecf30d4eb771 (patch) | |
tree | cabed5301053216ab424e6f554dc7595b1948bb3 /ale_linters/python/pylama.vim | |
parent | 530b38de342a21cce330a32af0c1b66671d335c2 (diff) | |
download | ale-7d8fb2ba1716a744446b811fc278ecf30d4eb771.zip |
Python support poetry (#3834)
* Add poetry support to python linters and black fixer.
* Update python.vim to detect poetry project.
* Update ale.vim, add an option for poetry `g:ale_python_auto_poetry`.
* Update ale-python.txt, add poetry support.
* Add and update poetry related tests.
Co-authored-by: unc0 <unc0@users.noreply.github.com>
Diffstat (limited to 'ale_linters/python/pylama.vim')
-rw-r--r-- | ale_linters/python/pylama.vim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ale_linters/python/pylama.vim b/ale_linters/python/pylama.vim index bad69667..73b59b07 100644 --- a/ale_linters/python/pylama.vim +++ b/ale_linters/python/pylama.vim @@ -5,6 +5,7 @@ call ale#Set('python_pylama_executable', 'pylama') call ale#Set('python_pylama_options', '') call ale#Set('python_pylama_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('python_pylama_auto_pipenv', 0) +call ale#Set('python_pylama_auto_poetry', 0) call ale#Set('python_pylama_change_directory', 1) function! ale_linters#python#pylama#GetExecutable(buffer) abort @@ -13,6 +14,11 @@ function! ale_linters#python#pylama#GetExecutable(buffer) abort return 'pipenv' endif + if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pylama_auto_poetry')) + \ && ale#python#PoetryPresent(a:buffer) + return 'poetry' + endif + return ale#python#FindExecutable(a:buffer, 'python_pylama', ['pylama']) endfunction @@ -31,7 +37,7 @@ endfunction function! ale_linters#python#pylama#GetCommand(buffer) abort let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer) - let l:exec_args = l:executable =~? 'pipenv$' + let l:exec_args = l:executable =~? 'pipenv\|poetry$' \ ? ' run pylama' \ : '' |