summaryrefslogtreecommitdiff
path: root/ale_linters/python/pylint.vim
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2017-01-15 13:02:51 +0000
committerGitHub <noreply@github.com>2017-01-15 13:02:51 +0000
commit548ff299f4d68890ec7d00a7d20a78c820b0bb2b (patch)
tree34472c2a428c4673c028d49b59ae291597266039 /ale_linters/python/pylint.vim
parent8762a6fa665b54c8a24bfe0139f4ee8cb2a52b99 (diff)
parentdc8166384c023b5de963cb21730b756f80286c90 (diff)
downloadale-548ff299f4d68890ec7d00a7d20a78c820b0bb2b.zip
Merge pull request #243 from SabatierBoris/master
Add options for pylint linter
Diffstat (limited to 'ale_linters/python/pylint.vim')
-rw-r--r--ale_linters/python/pylint.vim21
1 files changed, 19 insertions, 2 deletions
diff --git a/ale_linters/python/pylint.vim b/ale_linters/python/pylint.vim
index 9e6093c7..95e5f0ef 100644
--- a/ale_linters/python/pylint.vim
+++ b/ale_linters/python/pylint.vim
@@ -1,9 +1,26 @@
" Author: keith <k@keith.so>
" Description: pylint for python files
+let g:ale_python_pylint_executable =
+\ get(g:, 'ale_python_pylint_executable', 'pylint')
+
+let g:ale_python_pylint_args =
+\ get(g:, 'ale_python_pylint_args', '')
+
+function! ale_linters#python#pylint#GetExecutable(buffer) abort
+ return g:ale_python_pylint_executable
+endfunction
+
+function! ale_linters#python#pylint#GetCommand(buffer) abort
+ return g:ale#util#stdin_wrapper . ' .py '
+ \ . ale_linters#python#pylint#GetExecutable(a:buffer)
+ \ . ' ' . g:ale_python_pylint_args
+ \ . ' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} {msg}" --reports n'
+endfunction
+
call ale#linter#Define('python', {
\ 'name': 'pylint',
-\ 'executable': 'pylint',
-\ 'command': g:ale#util#stdin_wrapper . ' .py pylint --output-format text --msg-template="{path}:{line}:{column}: {msg_id} {msg}" --reports n',
+\ 'executable_callback': 'ale_linters#python#pylint#GetExecutable',
+\ 'command_callback': 'ale_linters#python#pylint#GetCommand',
\ 'callback': 'ale#handlers#HandlePEP8Format',
\})