summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorMatthew Lanigan <rintaun@gmail.com>2019-07-13 12:37:48 -0400
committerw0rp <w0rp@users.noreply.github.com>2019-07-13 17:37:48 +0100
commitabb38955d3acd452e37c15e7bae62022d1153859 (patch)
tree3dbb6b8d04a13c26d6f067e7c56da0aa59bcac03 /ale_linters
parent6c47d7fc352659cd2dc869a9a46a04a8492fc829 (diff)
downloadale-abb38955d3acd452e37c15e7bae62022d1153859.zip
Add Sorbet ruby linter and fixer (#2614)
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/ruby/sorbet.vim23
1 files changed, 23 insertions, 0 deletions
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')
+\})
+