summaryrefslogtreecommitdiff
path: root/ale_linters/python/pyflakes.vim
diff options
context:
space:
mode:
authorDaniel Roseman <daniel@roseman.org.uk>2021-07-25 05:39:05 +0100
committerGitHub <noreply@github.com>2021-07-25 13:39:05 +0900
commit7d8fb2ba1716a744446b811fc278ecf30d4eb771 (patch)
treecabed5301053216ab424e6f554dc7595b1948bb3 /ale_linters/python/pyflakes.vim
parent530b38de342a21cce330a32af0c1b66671d335c2 (diff)
downloadale-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/pyflakes.vim')
-rw-r--r--ale_linters/python/pyflakes.vim8
1 files changed, 7 insertions, 1 deletions
diff --git a/ale_linters/python/pyflakes.vim b/ale_linters/python/pyflakes.vim
index b5127022..2567c533 100644
--- a/ale_linters/python/pyflakes.vim
+++ b/ale_linters/python/pyflakes.vim
@@ -4,6 +4,7 @@
call ale#Set('python_pyflakes_executable', 'pyflakes')
call ale#Set('python_pyflakes_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pyflakes_auto_pipenv', 0)
+call ale#Set('python_pyflakes_auto_poetry', 0)
function! ale_linters#python#pyflakes#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyflakes_auto_pipenv'))
@@ -11,13 +12,18 @@ function! ale_linters#python#pyflakes#GetExecutable(buffer) abort
return 'pipenv'
endif
+ if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pyflakes_auto_poetry'))
+ \ && ale#python#PoetryPresent(a:buffer)
+ return 'poetry'
+ endif
+
return ale#python#FindExecutable(a:buffer, 'python_pyflakes', ['pyflakes'])
endfunction
function! ale_linters#python#pyflakes#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyflakes#GetExecutable(a:buffer)
- let l:exec_args = l:executable =~? 'pipenv$'
+ let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pyflakes'
\ : ''