summaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-24 01:02:46 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-24 03:31:57 -0400
commit6f97030bbbe2577c8c9b5b6e20347aa3e5b6250f (patch)
treece12e328940a566d29eeffecdb6d8ac3c88f8867 /vimrc
parent4fe59f0ea9a6370b614076dd270b33c9ba66f98e (diff)
downloadconf-6f97030bbbe2577c8c9b5b6e20347aa3e5b6250f.tar.gz
conf-6f97030bbbe2577c8c9b5b6e20347aa3e5b6250f.zip
use `bundle exec rubocop` when necessary
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc18
1 files changed, 18 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 2b1978d..405b5b5 100644
--- a/vimrc
+++ b/vimrc
@@ -660,6 +660,24 @@ let g:ale_linters = {
\}
let g:ale_rust_cargo_use_check = 1
+
+function! s:rubocop_in_bundler()
+ let gemfiles = glob("*.gemspec", 1, 1)
+ if filereadable("Gemfile")
+ let gemfiles += ["Gemfile"]
+ endif
+ for file in gemfiles
+ for line in readfile(file)
+ if line =~ 'gem.*rubocop'
+ return 1
+ endif
+ endfor
+ endfor
+ return 0
+endfunction
+if s:rubocop_in_bundler()
+ let g:ale_ruby_rubocop_executable = 'bundle'
+endif
" }}}
" airline
" commentary {{{