1
0
Fork 0
mirror of synced 2024-11-05 08:58:59 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/ruby/standardrb.vim

24 lines
1 KiB
VimL
Raw Normal View History

" Author: Justin Searls https://github.com/searls, ynonp - https://github.com/ynonp, Eddie Lebow https://github.com/elebow
" based on the ale rubocop linter
" Description: StandardRB - Ruby Style Guide, with linter & automatic code fixer
call ale#Set('ruby_standardrb_executable', 'standardrb')
call ale#Set('ruby_standardrb_options', '')
function! ale_linters#ruby#standardrb#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'ruby_standardrb_executable')
return ale#handlers#ruby#EscapeExecutable(l:executable, 'standardrb')
\ . ' --format json --force-exclusion '
\ . ale#Var(a:buffer, 'ruby_standardrb_options')
\ . ' --stdin ' . ale#Escape(expand('#' . a:buffer . ':p'))
endfunction
" standardrb is based on RuboCop so the callback is the same
call ale#linter#Define('ruby', {
\ 'name': 'standardrb',
2019-03-08 06:04:56 -05:00
\ 'executable': {b -> ale#Var(b, 'ruby_standardrb_executable')},
\ 'command': function('ale_linters#ruby#standardrb#GetCommand'),
\ 'callback': 'ale#ruby#HandleRubocopOutput',
\})