Add auto-fixer for crystal (#4016)

This commit is contained in:
Alex Piechowski
2021-12-28 20:23:57 +09:00
committed by GitHub
parent dcec4b3c37
commit 48f68598cb
3 changed files with 52 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
call ale#Set('crystal_format_executable', 'crystal')
call ale#Set('crystal_format_options', '')
function! ale#fixers#crystal#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'crystal_format_executable')
let l:options = ale#Var(a:buffer, 'crystal_format_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' tool format'
\ . ale#Pad(l:options)
\ . ' -'
\}
endfunction