mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Forgot to add the newly created files from the plugin update
This commit is contained in:
23
sources_non_forked/ale/ale_linters/ruby/standardrb.vim
Normal file
23
sources_non_forked/ale/ale_linters/ruby/standardrb.vim
Normal file
@ -0,0 +1,23 @@
|
||||
" 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',
|
||||
\ 'executable_callback': ale#VarFunc('ruby_standardrb_executable'),
|
||||
\ 'command_callback': 'ale_linters#ruby#standardrb#GetCommand',
|
||||
\ 'callback': 'ale#ruby#HandleRubocopOutput',
|
||||
\})
|
Reference in New Issue
Block a user