mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -36,7 +36,7 @@ function! ale_linters#ruby#brakeman#GetCommand(buffer) abort
|
||||
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_brakeman_executable')
|
||||
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'brakeman')
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'brakeman')
|
||||
\ . ' -f json -q '
|
||||
\ . ale#Var(a:buffer, 'ruby_brakeman_options')
|
||||
\ . ' -p ' . ale#Escape(l:rails_root)
|
||||
|
42
sources_non_forked/ale/ale_linters/ruby/debride.vim
Normal file
42
sources_non_forked/ale/ale_linters/ruby/debride.vim
Normal file
@ -0,0 +1,42 @@
|
||||
" Author: Eddie Lebow https://github.com/elebow
|
||||
" Description: debride, a dead method detector for Ruby files
|
||||
|
||||
call ale#Set('ruby_debride_executable', 'debride')
|
||||
call ale#Set('ruby_debride_options', '')
|
||||
|
||||
function! ale_linters#ruby#debride#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_debride_executable')
|
||||
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'debride')
|
||||
\ . ale#Var(a:buffer, 'ruby_debride_options')
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ruby#debride#HandleOutput(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
for l:line in a:lines
|
||||
if l:line !~# '^ '
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:elements = split(l:line)
|
||||
let l:method_name = l:elements[0]
|
||||
let l:lnum = split(l:elements[1], ':')[1]
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': 0 + l:lnum,
|
||||
\ 'text': 'Possible unused method: ' . l:method_name,
|
||||
\ 'type': 'W',
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('ruby', {
|
||||
\ 'name': 'debride',
|
||||
\ 'executable': {b -> ale#Var(b, 'ruby_debride_executable')},
|
||||
\ 'command': function('ale_linters#ruby#debride#GetCommand'),
|
||||
\ 'callback': 'ale_linters#ruby#debride#HandleOutput',
|
||||
\})
|
@ -33,7 +33,7 @@ function! ale_linters#ruby#rails_best_practices#GetCommand(buffer) abort
|
||||
let l:output_file = has('win32') ? '%t ' : '/dev/stdout '
|
||||
let l:cat_file = has('win32') ? '; type %t' : ''
|
||||
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'rails_best_practices')
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'rails_best_practices')
|
||||
\ . ' --silent -f json --output-file ' . l:output_file
|
||||
\ . ale#Var(a:buffer, 'ruby_rails_best_practices_options')
|
||||
\ . ale#Escape(l:rails_root)
|
||||
|
@ -14,7 +14,7 @@ function! ale_linters#ruby#reek#GetCommand(buffer, version) abort
|
||||
\ ? ' --stdin-filename %s'
|
||||
\ : ''
|
||||
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'reek')
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'reek')
|
||||
\ . ' -f json --no-progress --no-color --force-exclusion'
|
||||
\ . l:display_name_args
|
||||
endfunction
|
||||
|
@ -7,7 +7,7 @@ call ale#Set('ruby_rubocop_options', '')
|
||||
function! ale_linters#ruby#rubocop#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_rubocop_executable')
|
||||
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'rubocop')
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'rubocop')
|
||||
\ . ' --format json --force-exclusion '
|
||||
\ . ale#Var(a:buffer, 'ruby_rubocop_options')
|
||||
\ . ' --stdin ' . ale#Escape(expand('#' . a:buffer . ':p'))
|
||||
|
@ -5,7 +5,7 @@ function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
|
||||
let l:options = ale#Var(a:buffer, 'ruby_sorbet_options')
|
||||
|
||||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'srb')
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'srb')
|
||||
\ . ' tc'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --lsp --disable-watchman'
|
||||
|
@ -8,7 +8,7 @@ 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')
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'standardrb')
|
||||
\ . ' --format json --force-exclusion '
|
||||
\ . ale#Var(a:buffer, 'ruby_standardrb_options')
|
||||
\ . ' --stdin ' . ale#Escape(expand('#' . a:buffer . ':p'))
|
||||
|
Reference in New Issue
Block a user