Fix 3897 - add poetry to isort (#3898)

Co-authored-by: Horacio Sanson <horacio@allm.inc>
This commit is contained in:
Horacio Sanson
2021-09-10 15:18:41 +09:00
committed by GitHub
parent b504eeb094
commit bf29f6ea92
3 changed files with 41 additions and 17 deletions

View File

@@ -10,10 +10,6 @@ After:
unlet! b:bin_dir
Execute(The isort callback should return the correct default values):
AssertEqual
\ 0,
\ ale#fixers#isort#Fix(bufnr(''))
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
@@ -25,10 +21,6 @@ Execute(The isort callback should return the correct default values):
Execute(The isort callback should respect custom options):
let g:ale_python_isort_options = '--multi-line=3 --trailing-comma'
AssertEqual
\ 0,
\ ale#fixers#isort#Fix(bufnr(''))
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
@@ -49,3 +41,15 @@ Execute(Pipenv is detected when python_isort_auto_pipenv is set):
\ 'command': ale#Escape('pipenv') . ' run isort' . ' --filename %s' . ' -'
\ },
\ ale#fixers#isort#Fix(bufnr(''))
Execute(Poetry is detected when python_isort_auto_poetry is set):
let g:ale_python_isort_auto_poetry = 1
call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
AssertEqual
\ {
\ 'cwd': '%s:h',
\ 'command': ale#Escape('poetry') . ' run isort' . ' --filename %s' . ' -'
\ },
\ ale#fixers#isort#Fix(bufnr(''))