summaryrefslogtreecommitdiff
path: root/ale_linters/python/flake8.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/python/flake8.vim')
-rw-r--r--ale_linters/python/flake8.vim8
1 files changed, 7 insertions, 1 deletions
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index 1d49d03f..9950614a 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -6,6 +6,7 @@ call ale#Set('python_flake8_options', '')
call ale#Set('python_flake8_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_flake8_change_directory', 'project')
call ale#Set('python_flake8_auto_pipenv', 0)
+call ale#Set('python_flake8_auto_poetry', 0)
function! s:UsingModule(buffer) abort
return ale#Var(a:buffer, 'python_flake8_options') =~# ' *-m flake8'
@@ -17,6 +18,11 @@ function! ale_linters#python#flake8#GetExecutable(buffer) abort
return 'pipenv'
endif
+ if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_flake8_auto_poetry'))
+ \ && ale#python#PoetryPresent(a:buffer)
+ return 'poetry'
+ endif
+
if !s:UsingModule(a:buffer)
return ale#python#FindExecutable(a:buffer, 'python_flake8', ['flake8'])
endif
@@ -62,7 +68,7 @@ endfunction
function! ale_linters#python#flake8#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
- let l:exec_args = l:executable =~? 'pipenv$'
+ let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run flake8'
\ : ''