mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-24 04:51:29 +08:00
Merge pull request #1698 from dsifford/dsifford-isort-options
add options variable to isort
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
Before:
|
||||
Save g:ale_python_isort_executable
|
||||
Save g:ale_python_isort_options
|
||||
|
||||
" Use an invalid global executable, so we don't match it.
|
||||
let g:ale_python_isort_executable = 'xxxinvalid'
|
||||
@@ -30,3 +31,19 @@ Execute(The isort callback should return the correct default values):
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' -',
|
||||
\ },
|
||||
\ ale#fixers#isort#Fix(bufnr(''))
|
||||
|
||||
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 . '/python_paths/with_virtualenv/subdir/foo/bar.py')
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir/foo')) . ' && '
|
||||
\ . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort'))
|
||||
\ . ' --multi-line=3 --trailing-comma -',
|
||||
\ },
|
||||
\ ale#fixers#isort#Fix(bufnr(''))
|
||||
|
||||
Reference in New Issue
Block a user