mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
[rubyfmt](https://github.com/fables-tales/rubyfmt) is a formatter for `ruby` code. This commit adds support for `rubyfmt` as a `ruby` fixer (#2991), together with some tests and documentation.
17 lines
506 B
VimL
17 lines
506 B
VimL
" Author: Yining <zhang.yining@gmail.com>
|
|
" Description: support rubyfmt as ALE fixer for Ruby files
|
|
|
|
call ale#Set('ruby_rubyfmt_executable', 'rubyfmt')
|
|
call ale#Set('ruby_rubyfmt_options', '')
|
|
|
|
function! ale#fixers#rubyfmt#Fix(buffer) abort
|
|
let l:executable = ale#Var(a:buffer, 'ruby_rubyfmt_executable')
|
|
let l:options = ale#Var(a:buffer, 'ruby_rubyfmt_options')
|
|
|
|
return {
|
|
\ 'command': ale#Escape(l:executable)
|
|
\ . (empty(l:options) ? '' : ' ' . l:options)
|
|
\}
|
|
endfunction
|
|
|