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/prospector.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/prospector.vim')
-rw-r--r-- | ale_linters/python/prospector.vim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ale_linters/python/prospector.vim b/ale_linters/python/prospector.vim index ee47012f..3623bda0 100644 --- a/ale_linters/python/prospector.vim +++ b/ale_linters/python/prospector.vim @@ -2,6 +2,7 @@ " Description: prospector linter python files call ale#Set('python_prospector_auto_pipenv', 0) +call ale#Set('python_prospector_auto_poetry', 0) let g:ale_python_prospector_executable = \ get(g:, 'ale_python_prospector_executable', 'prospector') @@ -17,13 +18,18 @@ function! ale_linters#python#prospector#GetExecutable(buffer) abort return 'pipenv' endif + if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_prospector_auto_poetry')) + \ && ale#python#PoetryPresent(a:buffer) + return 'poetry' + endif + return ale#python#FindExecutable(a:buffer, 'python_prospector', ['prospector']) endfunction function! ale_linters#python#prospector#GetCommand(buffer) abort let l:executable = ale_linters#python#prospector#GetExecutable(a:buffer) - let l:exec_args = l:executable =~? 'pipenv$' + let l:exec_args = l:executable =~? 'pipenv\|poetry$' \ ? ' run prospector' \ : '' |