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
2021-02-11 15:29:23 -05:00
committed by GitHub
parent 3b184f88d3
commit 8cb9f5ef51
2 changed files with 21 additions and 18 deletions

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