From 7d8fb2ba1716a744446b811fc278ecf30d4eb771 Mon Sep 17 00:00:00 2001 From: Daniel Roseman Date: Sun, 25 Jul 2021 05:39:05 +0100 Subject: 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 --- ale_linters/python/pylint.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ale_linters/python/pylint.vim') diff --git a/ale_linters/python/pylint.vim b/ale_linters/python/pylint.vim index f086a865..2ce5376f 100644 --- a/ale_linters/python/pylint.vim +++ b/ale_linters/python/pylint.vim @@ -6,6 +6,7 @@ call ale#Set('python_pylint_options', '') call ale#Set('python_pylint_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('python_pylint_change_directory', 1) call ale#Set('python_pylint_auto_pipenv', 0) +call ale#Set('python_pylint_auto_poetry', 0) call ale#Set('python_pylint_use_msg_id', 0) function! ale_linters#python#pylint#GetExecutable(buffer) abort @@ -14,6 +15,11 @@ function! ale_linters#python#pylint#GetExecutable(buffer) abort return 'pipenv' endif + if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pylint_auto_poetry')) + \ && ale#python#PoetryPresent(a:buffer) + return 'poetry' + endif + return ale#python#FindExecutable(a:buffer, 'python_pylint', ['pylint']) endfunction @@ -32,7 +38,7 @@ endfunction function! ale_linters#python#pylint#GetCommand(buffer, version) abort let l:executable = ale_linters#python#pylint#GetExecutable(a:buffer) - let l:exec_args = l:executable =~? 'pipenv$' + let l:exec_args = l:executable =~? 'pipenv\|poetry$' \ ? ' run pylint' \ : '' -- cgit v1.2.3