diff options
author | Jesse Luehrs <doy@tozt.net> | 2017-10-24 01:02:46 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2017-10-24 03:31:57 -0400 |
commit | 6f97030bbbe2577c8c9b5b6e20347aa3e5b6250f (patch) | |
tree | ce12e328940a566d29eeffecdb6d8ac3c88f8867 /vimrc | |
parent | 4fe59f0ea9a6370b614076dd270b33c9ba66f98e (diff) | |
download | conf-6f97030bbbe2577c8c9b5b6e20347aa3e5b6250f.tar.gz conf-6f97030bbbe2577c8c9b5b6e20347aa3e5b6250f.zip |
use `bundle exec rubocop` when necessary
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 {{{ |