2018-12-06 18:27:03 +00:00
|
|
|
Before:
|
|
|
|
call ale#assert#SetUpLinterTest('python', 'pydocstyle')
|
2020-08-28 16:46:43 +00:00
|
|
|
call ale#test#SetFilename('test.py')
|
2018-12-06 18:27:03 +00:00
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
|
|
|
|
Execute(The pydocstyle command callback should return default string):
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinterCwd '%s:h'
|
|
|
|
AssertLinter 'pydocstyle', ale#Escape('pydocstyle') . ' %s:t'
|
2018-12-06 18:27:03 +00:00
|
|
|
|
|
|
|
Execute(The pydocstyle command callback should allow options):
|
|
|
|
let g:ale_python_pydocstyle_options = '--verbose'
|
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinter 'pydocstyle', ale#Escape('pydocstyle') . ' --verbose %s:t'
|
2018-12-06 18:27:03 +00:00
|
|
|
|
|
|
|
Execute(The pydocstyle executable should be configurable):
|
|
|
|
let g:ale_python_pydocstyle_executable = '~/.local/bin/pydocstyle'
|
|
|
|
|
|
|
|
AssertLinter '~/.local/bin/pydocstyle',
|
2021-03-01 20:11:10 +00:00
|
|
|
\ ale#Escape('~/.local/bin/pydocstyle') . ' %s:t'
|
2018-12-06 18:27:03 +00:00
|
|
|
|
|
|
|
Execute(Setting executable to 'pipenv' appends 'run pydocstyle'):
|
|
|
|
let g:ale_python_pydocstyle_executable = 'path/to/pipenv'
|
|
|
|
|
|
|
|
AssertLinter 'path/to/pipenv',
|
2021-03-01 20:11:10 +00:00
|
|
|
\ ale#Escape('path/to/pipenv') . ' run pydocstyle %s:t'
|
2018-12-06 18:27:03 +00:00
|
|
|
|
|
|
|
Execute(Pipenv is detected when python_pydocstyle_auto_pipenv is set):
|
|
|
|
let g:ale_python_pydocstyle_auto_pipenv = 1
|
2020-08-28 16:46:43 +00:00
|
|
|
call ale#test#SetFilename('../python_fixtures/pipenv/whatever.py')
|
2018-12-06 18:27:03 +00:00
|
|
|
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinter 'pipenv', ale#Escape('pipenv') . ' run pydocstyle %s:t'
|