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`
This commit is contained in:
Daniel Leong authored and GitHub committed 2021-02-11 20:29:23 +00:00
1 parent 3b184f88d3
commit 8cb9f5ef51
2 files changed
+21 -18

No files matched your search

+4 -2
View File
@@ -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