diff options
author | Eddie Lebow <elebow@users.noreply.github.com> | 2018-06-04 22:43:02 -0400 |
---|---|---|
committer | Eddie Lebow <elebow@users.noreply.github.com> | 2018-06-05 00:33:26 -0400 |
commit | ca88e67af0dc159bdb78ad9f038d2c9336fb1b71 (patch) | |
tree | c170d053015f209714fee82d0b654981e9db45ec /ale_linters/python/mypy.vim | |
parent | 5addd3abefdbc828d92386e27dedfa79d39c5d9d (diff) | |
download | ale-ca88e67af0dc159bdb78ad9f038d2c9336fb1b71.zip |
Allow all Python linter executables to be set to `pipenv`.
It appends ` run {linter_name}`, analogously to the Ruby linters when
the executable is set to `bundle`
Diffstat (limited to 'ale_linters/python/mypy.vim')
-rw-r--r-- | ale_linters/python/mypy.vim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ale_linters/python/mypy.vim b/ale_linters/python/mypy.vim index e8ceb6a3..b38ccdeb 100644 --- a/ale_linters/python/mypy.vim +++ b/ale_linters/python/mypy.vim @@ -23,10 +23,14 @@ function! ale_linters#python#mypy#GetCommand(buffer) abort let l:dir = s:GetDir(a:buffer) let l:executable = ale_linters#python#mypy#GetExecutable(a:buffer) + let l:exec_args = l:executable =~? 'pipenv$' + \ ? ' run mypy' + \ : '' + " 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) + \ . ale#Escape(l:executable) . l:exec_args \ . ' --show-column-numbers ' \ . ale#Var(a:buffer, 'python_mypy_options') \ . ' --shadow-file %s %t %s' |