add perltidy fixer
This commit is contained in:
@@ -185,6 +185,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['json'],
|
||||
\ 'description': 'Fix JSON files with jq.',
|
||||
\ },
|
||||
\ 'perltidy': {
|
||||
\ 'function': 'ale#fixers#perltidy#Fix',
|
||||
\ 'suggested_filetypes': ['perl'],
|
||||
\ 'description': 'Fix Perl files with perltidy.',
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
||||
18
autoload/ale/fixers/perltidy.vim
Normal file
18
autoload/ale/fixers/perltidy.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
" Author: kfly8 <kentafly88@gmail.com>
|
||||
" Description: Integration of perltidy with ALE.
|
||||
|
||||
call ale#Set('perl_perltidy_executable', 'perltidy')
|
||||
call ale#Set('perl_perltidy_options', '')
|
||||
|
||||
function! ale#fixers#perltidy#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'perl_perltidy_executable')
|
||||
let l:options = ale#Var(a:buffer, 'perl_perltidy_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -b'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user