2018-12-06 18:27:03 +00:00
|
|
|
Before:
|
|
|
|
call ale#assert#SetUpLinterTest('python', 'pydocstyle')
|
2021-12-09 14:24:32 +00:00
|
|
|
call ale#test#SetFilename('example/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'
|
2021-12-09 14:24:32 +00:00
|
|
|
AssertLinter 'pydocstyle', ale#Escape('pydocstyle') . ' %s'
|
2018-12-06 18:27:03 +00:00
|
|
|
|
|
|
|
Execute(The pydocstyle command callback should allow options):
|
|
|
|
let g:ale_python_pydocstyle_options = '--verbose'
|
|
|
|
|
2021-12-09 14:24:32 +00:00
|
|
|
AssertLinter 'pydocstyle', ale#Escape('pydocstyle') . ' --verbose %s'
|
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-12-09 14:24:32 +00:00
|
|
|
\ ale#Escape('~/.local/bin/pydocstyle') . ' %s'
|
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-12-09 14:24:32 +00:00
|
|
|
\ ale#Escape('path/to/pipenv') . ' run pydocstyle %s'
|
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
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
|
2018-12-06 18:27:03 +00:00
|
|
|
|
2021-12-09 14:24:32 +00:00
|
|
|
AssertLinter 'pipenv', ale#Escape('pipenv') . ' run pydocstyle %s'
|
2021-07-25 04:39:05 +00:00
|
|
|
|
|
|
|
Execute(Setting executable to 'poetry' appends 'run pydocstyle'):
|
|
|
|
let g:ale_python_pydocstyle_executable = 'path/to/poetry'
|
|
|
|
|
|
|
|
AssertLinter 'path/to/poetry',
|
2021-12-09 14:24:32 +00:00
|
|
|
\ ale#Escape('path/to/poetry') . ' run pydocstyle %s'
|
2021-07-25 04:39:05 +00:00
|
|
|
|
|
|
|
Execute(Poetry is detected when python_pydocstyle_auto_poetry is set):
|
|
|
|
let g:ale_python_pydocstyle_auto_poetry = 1
|
|
|
|
call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
|
|
|
|
|
2021-12-09 14:24:32 +00:00
|
|
|
AssertLinter 'poetry', ale#Escape('poetry') . ' run pydocstyle %s'
|