Fix 3167 - add custom fixer example to help docs. (#3541)

Co-authored-by: Horacio Sanson <horacio@allm.inc>
This commit is contained in:
Horacio Sanson 2021-06-19 19:47:35 +09:00 committed by GitHub
parent 2c8a857262
commit 88817b3780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -3734,6 +3734,21 @@ ale#fix#registry#Add(name, func, filetypes, desc, [aliases])
ALE will search for fixers in the registry first by `name`, then by their
`aliases`.
For example to register a custom fixer for `luafmt`: >
function! FormatLua(buffer) abort
return {
\ 'command': 'luafmt --stdin'
\}
endfunction
execute ale#fix#registry#Add('luafmt', 'FormatLua', ['lua'], 'luafmt for lua')
" You can now use it in g:ale_fixers
let g:ale_fixers = {
\ 'lua': ['luafmt']
}
<
ale#linter#Define(filetype, linter) *ale#linter#Define()*