diff options
Diffstat (limited to 'ale_linters/python/bandit.vim')
-rw-r--r-- | ale_linters/python/bandit.vim | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ale_linters/python/bandit.vim b/ale_linters/python/bandit.vim index 554f5000..9cfca7c0 100644 --- a/ale_linters/python/bandit.vim +++ b/ale_linters/python/bandit.vim @@ -6,6 +6,7 @@ call ale#Set('python_bandit_options', '') call ale#Set('python_bandit_use_config', 1) call ale#Set('python_bandit_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('python_bandit_auto_pipenv', 0) +call ale#Set('python_bandit_auto_poetry', 0) function! ale_linters#python#bandit#GetExecutable(buffer) abort if ( @@ -15,6 +16,13 @@ function! ale_linters#python#bandit#GetExecutable(buffer) abort return 'pipenv' endif + if ( + \ ale#Var(a:buffer, 'python_auto_poetry') + \ || ale#Var(a:buffer, 'python_bandit_auto_poetry') + \) && ale#python#PoetryPresent(a:buffer) + return 'poetry' + endif + return ale#python#FindExecutable(a:buffer, 'python_bandit', ['bandit']) endfunction @@ -31,7 +39,7 @@ function! ale_linters#python#bandit#GetCommand(buffer) abort endif endif - let l:exec_args = l:executable =~? 'pipenv$' + let l:exec_args = l:executable =~? 'pipenv\|poetry$' \ ? ' run bandit' \ : '' |