mirror of
https://github.com/dense-analysis/ale.git
synced 2026-09-29 15:12:20 +08:00
Add some more tools for fixing problems with Python files
This commit is contained in:
@@ -41,3 +41,25 @@ function! ale#handlers#python#AutoPEP8(buffer, lines) abort
|
||||
\ 'command': 'autopep8 -'
|
||||
\}
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#python#ISort(buffer, lines) abort
|
||||
let l:config = ale#path#FindNearestFile(a:buffer, '.isort.cfg')
|
||||
let l:config_options = !empty(l:config)
|
||||
\ ? ' --settings-path ' . ale#Escape(l:config)
|
||||
\ : ''
|
||||
|
||||
return {
|
||||
\ 'command': 'isort' . l:config_options . ' -',
|
||||
\}
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#python#YAPF(buffer, lines) abort
|
||||
let l:config = ale#path#FindNearestFile(a:buffer, '.style.yapf')
|
||||
let l:config_options = !empty(l:config)
|
||||
\ ? ' --style ' . ale#Escape(l:config)
|
||||
\ : ''
|
||||
|
||||
return {
|
||||
\ 'command': 'yapf --no-local-style' . l:config_options,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user