Merge pull request #1698 from dsifford/dsifford-isort-options

add options variable to isort
This commit is contained in:
w0rp
2018-07-05 09:25:16 +01:00
committed by GitHub
3 changed files with 29 additions and 1 deletions

View File

@@ -2,9 +2,12 @@
" Description: Fixing Python imports with isort.
call ale#Set('python_isort_executable', 'isort')
call ale#Set('python_isort_options', '')
call ale#Set('python_isort_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale#fixers#isort#Fix(buffer) abort
let l:options = ale#Var(a:buffer, 'python_isort_options')
let l:executable = ale#python#FindExecutable(
\ a:buffer,
\ 'python_isort',
@@ -17,6 +20,6 @@ function! ale#fixers#isort#Fix(buffer) abort
return {
\ 'command': ale#path#BufferCdString(a:buffer)
\ . ale#Escape(l:executable) . ' -',
\ . ale#Escape(l:executable) . (!empty(l:options) ? ' ' . l:options : '') . ' -',
\}
endfunction