From abb38955d3acd452e37c15e7bae62022d1153859 Mon Sep 17 00:00:00 2001 From: Matthew Lanigan Date: Sat, 13 Jul 2019 12:37:48 -0400 Subject: Add Sorbet ruby linter and fixer (#2614) --- ale_linters/ruby/sorbet.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ale_linters/ruby/sorbet.vim (limited to 'ale_linters/ruby/sorbet.vim') diff --git a/ale_linters/ruby/sorbet.vim b/ale_linters/ruby/sorbet.vim new file mode 100644 index 00000000..ee765a6e --- /dev/null +++ b/ale_linters/ruby/sorbet.vim @@ -0,0 +1,23 @@ +call ale#Set('ruby_sorbet_executable', 'srb') +call ale#Set('ruby_sorbet_options', '') + +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') + \ . ' tc' + \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ' --lsp --disable-watchman' +endfunction + +call ale#linter#Define('ruby', { +\ 'name': 'sorbet', +\ 'aliases': ['srb'], +\ 'lsp': 'stdio', +\ 'language': 'ruby', +\ 'executable': {b -> ale#Var(b, 'ruby_sorbet_executable')}, +\ 'command': function('ale_linters#ruby#sorbet#GetCommand'), +\ 'project_root': function('ale#ruby#FindProjectRoot') +\}) + -- cgit v1.2.3