2018-12-17 06:33:49 -05:00
|
|
|
" 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')
|
|
|
|
|
2019-11-16 10:28:42 -05:00
|
|
|
return ale#ruby#EscapeExecutable(l:executable, 'standardrb')
|
2018-12-17 06:33:49 -05:00
|
|
|
\ . ' --format json --force-exclusion '
|
|
|
|
\ . ale#Var(a:buffer, 'ruby_standardrb_options')
|
2020-12-04 16:15:32 -05:00
|
|
|
\ . ' --stdin %s'
|
2018-12-17 06:33:49 -05:00
|
|
|
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'),
|
2018-12-17 06:33:49 -05:00
|
|
|
\ 'callback': 'ale#ruby#HandleRubocopOutput',
|
|
|
|
\})
|