2017-08-25 11:46:56 +00:00
|
|
|
Before:
|
2017-11-15 17:21:17 +00:00
|
|
|
Save g:ale_python_pycodestyle_executable
|
|
|
|
Save g:ale_python_pycodestyle_options
|
|
|
|
Save g:ale_python_pycodestyle_use_global
|
|
|
|
|
2017-08-25 11:46:56 +00:00
|
|
|
runtime ale_linters/python/pycodestyle.vim
|
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
2017-11-15 17:21:17 +00:00
|
|
|
call ale#linter#Reset()
|
|
|
|
|
2017-08-25 11:46:56 +00:00
|
|
|
Execute(The pycodestyle command callback should return default string):
|
2017-10-08 22:26:50 +00:00
|
|
|
AssertEqual ale#Escape('pycodestyle') . ' -',
|
2017-08-25 11:46:56 +00:00
|
|
|
\ ale_linters#python#pycodestyle#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The pycodestyle command callback should allow options):
|
|
|
|
let g:ale_python_pycodestyle_options = '--exclude=test*.py'
|
2017-10-08 22:26:50 +00:00
|
|
|
|
|
|
|
AssertEqual ale#Escape('pycodestyle') . ' --exclude=test*.py -',
|
2017-08-25 11:46:56 +00:00
|
|
|
\ ale_linters#python#pycodestyle#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The pycodestyle executable should be configurable):
|
|
|
|
let g:ale_python_pycodestyle_executable = '~/.local/bin/pycodestyle'
|
2017-10-08 22:26:50 +00:00
|
|
|
|
|
|
|
AssertEqual ale#Escape('~/.local/bin/pycodestyle') . ' -',
|
2017-08-25 11:46:56 +00:00
|
|
|
\ ale_linters#python#pycodestyle#GetCommand(bufnr(''))
|
2018-06-05 02:43:02 +00:00
|
|
|
|
|
|
|
Execute(Setting executable to 'pipenv' appends 'run pycodestyle'):
|
|
|
|
let g:ale_python_pycodestyle_executable = 'path/to/pipenv'
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ ale#Escape('path/to/pipenv') . ' run pycodestyle -',
|
|
|
|
\ ale_linters#python#pycodestyle#GetCommand(bufnr(''))
|