summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ale_linters/python/pylint.vim2
-rw-r--r--test/command_callback/test_pylint_command_callback.vader13
2 files changed, 14 insertions, 1 deletions
diff --git a/ale_linters/python/pylint.vim b/ale_linters/python/pylint.vim
index fa76a076..b2cc07f3 100644
--- a/ale_linters/python/pylint.vim
+++ b/ale_linters/python/pylint.vim
@@ -26,7 +26,7 @@ function! ale_linters#python#pylint#GetExecutable(buffer) abort
endfunction
function! ale_linters#python#pylint#GetCommand(buffer) abort
- return ale_linters#python#pylint#GetExecutable(a:buffer)
+ return fnameescape(ale_linters#python#pylint#GetExecutable(a:buffer))
\ . ' ' . ale#Var(a:buffer, 'python_pylint_options')
\ . ' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n'
\ . ' %s'
diff --git a/test/command_callback/test_pylint_command_callback.vader b/test/command_callback/test_pylint_command_callback.vader
index 7c8e4080..533d06a2 100644
--- a/test/command_callback/test_pylint_command_callback.vader
+++ b/test/command_callback/test_pylint_command_callback.vader
@@ -6,6 +6,9 @@ Before:
After:
silent execute 'cd ' . fnameescape(g:dir)
+ " Set the file to something else,
+ " or we'll cause issues when running other tests
+ silent file 'dummy.py'
unlet! g:dir
call ale#linter#Reset()
@@ -21,6 +24,16 @@ Execute(The pylint callbacks should return the correct default values):
\ 'pylint ' . b:command_tail,
\ ale_linters#python#pylint#GetCommand(bufnr(''))
+Execute(The pylint executable should be configurable, and escaped properly):
+ let g:ale_python_pylint_executable = 'executable with spaces'
+
+ AssertEqual
+ \ 'executable with spaces',
+ \ ale_linters#python#pylint#GetExecutable(bufnr(''))
+ AssertEqual
+ \ 'executable\ with\ spaces ' . b:command_tail,
+ \ ale_linters#python#pylint#GetCommand(bufnr(''))
+
Execute(The pylint command callback should let you set options):
let g:ale_python_pylint_options = '--some-option'