summaryrefslogtreecommitdiff
path: root/ale_linters/python/pylint.vim
diff options
context:
space:
mode:
authorKatsuya Horiuchi <katsuya.horiuchi.biz@gmail.com>2019-05-10 01:28:18 +0900
committerw0rp <w0rp@users.noreply.github.com>2019-05-09 17:28:18 +0100
commitf444abdfe66696505cb891889b18c4144d12d4ea (patch)
treec0b5c57c854c9e69dcc5a243fc2758f81aed98bc /ale_linters/python/pylint.vim
parent722c3e8dae80b9cea738ddb3df4f7d066d669e53 (diff)
downloadale-f444abdfe66696505cb891889b18c4144d12d4ea.zip
Add option to show msg id when pylint is used (#2445)
* Add python_pylint_use_msg_id to tweak output of pylint * Add test for ale_python_pylint_use_msg_id * Add doc on ale_python_pylint_use_msg_id
Diffstat (limited to 'ale_linters/python/pylint.vim')
-rw-r--r--ale_linters/python/pylint.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/ale_linters/python/pylint.vim b/ale_linters/python/pylint.vim
index 57e82691..b16d5355 100644
--- a/ale_linters/python/pylint.vim
+++ b/ale_linters/python/pylint.vim
@@ -6,6 +6,7 @@ call ale#Set('python_pylint_options', '')
call ale#Set('python_pylint_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pylint_change_directory', 1)
call ale#Set('python_pylint_auto_pipenv', 0)
+call ale#Set('python_pylint_use_msg_id', 0)
function! ale_linters#python#pylint#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pylint_auto_pipenv'))
@@ -64,11 +65,17 @@ function! ale_linters#python#pylint#Handle(buffer, lines) abort
continue
endif
+ if ale#Var(a:buffer, 'python_pylint_use_msg_id') is# 1
+ let l:code_out = l:code
+ else
+ let l:code_out = l:match[4]
+ endif
+
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 1,
\ 'text': l:match[5],
- \ 'code': l:match[4],
+ \ 'code': l:code_out,
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
\})
endfor