2017-08-25 07:46:56 -04:00
|
|
|
Before:
|
2017-11-15 12:21:17 -05:00
|
|
|
Save g:ale_python_pycodestyle_executable
|
|
|
|
Save g:ale_python_pycodestyle_options
|
|
|
|
Save g:ale_python_pycodestyle_use_global
|
|
|
|
|
2017-08-25 07:46:56 -04:00
|
|
|
runtime ale_linters/python/pycodestyle.vim
|
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
2017-11-15 12:21:17 -05:00
|
|
|
call ale#linter#Reset()
|
|
|
|
|
2017-08-25 07:46:56 -04:00
|
|
|
Execute(The pycodestyle command callback should return default string):
|
2017-10-08 18:26:50 -04:00
|
|
|
AssertEqual ale#Escape('pycodestyle') . ' -',
|
2017-08-25 07:46:56 -04: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 18:26:50 -04:00
|
|
|
|
|
|
|
AssertEqual ale#Escape('pycodestyle') . ' --exclude=test*.py -',
|
2017-08-25 07:46:56 -04: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 18:26:50 -04:00
|
|
|
|
|
|
|
AssertEqual ale#Escape('~/.local/bin/pycodestyle') . ' -',
|
2017-08-25 07:46:56 -04:00
|
|
|
\ ale_linters#python#pycodestyle#GetCommand(bufnr(''))
|
2018-06-04 22:43:02 -04: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(''))
|