summaryrefslogtreecommitdiff
path: root/ale_linters/python
diff options
context:
space:
mode:
authorDaniel Leong <falcone88@gmail.com>2021-02-11 15:29:23 -0500
committerGitHub <noreply@github.com>2021-02-11 20:29:23 +0000
commit8cb9f5ef515f73eb3cf3188cc20ff57a51d9217b (patch)
tree01f7d9e298f664a87ed3e2b8ebbef52e4e72c07d /ale_linters/python
parent3b184f88d32ff6492e99633f3c83d96c7a0caede (diff)
downloadale-8cb9f5ef515f73eb3cf3188cc20ff57a51d9217b.zip
mypy: Pass user options before any others (#3582)
This enables us to use a custom `python` exe as the "mypy" executable and pass `-m mypy` in `mypy_options`
Diffstat (limited to 'ale_linters/python')
-rw-r--r--ale_linters/python/mypy.vim6
1 files changed, 4 insertions, 2 deletions
diff --git a/ale_linters/python/mypy.vim b/ale_linters/python/mypy.vim
index 94dfae7d..1e35d929 100644
--- a/ale_linters/python/mypy.vim
+++ b/ale_linters/python/mypy.vim
@@ -43,12 +43,14 @@ function! ale_linters#python#mypy#GetCommand(buffer) abort
\ ? ' run mypy'
\ : ''
+ let l:options = ale#Var(a:buffer, 'python_mypy_options')
+
" We have to always switch to an explicit directory for a command so
" we can know with certainty the base path for the 'filename' keys below.
return ale#path#CdString(l:dir)
\ . ale#Escape(l:executable) . l:exec_args
- \ . ' --show-column-numbers '
- \ . ale#Var(a:buffer, 'python_mypy_options')
+ \ . (len(l:options) ? (' ' . l:options) : '')
+ \ . ' --show-column-numbers'
\ . ' --shadow-file %s %t %s'
endfunction