mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Improve support for python package manage: pipenv, poetry and uv (#4825)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
This commit is contained in:
committed by
GitHub
parent
954682108d
commit
a7ef1817b7
@@ -7,6 +7,7 @@ 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)
|
||||
call ale#Set('python_bandit_auto_uv', 0)
|
||||
|
||||
function! ale_linters#python#bandit#GetExecutable(buffer) abort
|
||||
if (
|
||||
@@ -23,6 +24,11 @@ function! ale_linters#python#bandit#GetExecutable(buffer) abort
|
||||
return 'poetry'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_bandit_auto_uv'))
|
||||
\ && ale#python#UvPresent(a:buffer)
|
||||
return 'uv'
|
||||
endif
|
||||
|
||||
return ale#python#FindExecutable(a:buffer, 'python_bandit', ['bandit'])
|
||||
endfunction
|
||||
|
||||
@@ -39,7 +45,7 @@ function! ale_linters#python#bandit#GetCommand(buffer) abort
|
||||
endif
|
||||
endif
|
||||
|
||||
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
|
||||
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
|
||||
\ ? ' run bandit'
|
||||
\ : ''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user