mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-30 22:55:30 +08:00
Add stylua fixer for lua (#3789)
This commit is contained in:
14
autoload/ale/fixers/stylua.vim
Normal file
14
autoload/ale/fixers/stylua.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Author: Robert Liebowitz <rliebz@gmail.com>
|
||||
" Description: https://github.com/johnnymorganz/stylua
|
||||
|
||||
call ale#Set('lua_stylua_executable', 'stylua')
|
||||
call ale#Set('lua_stylua_options', '')
|
||||
|
||||
function! ale#fixers#stylua#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'lua_stylua_executable')
|
||||
let l:options = ale#Var(a:buffer, 'lua_stylua_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ale#Pad(l:options) . ' -',
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user