summaryrefslogtreecommitdiff
path: root/ale_linters/ruby/rubocop.vim
diff options
context:
space:
mode:
authorPo Shan Cheah <pcheah@icetec.com>2016-12-01 12:28:27 -0500
committerPo Shan Cheah <pcheah@icetec.com>2016-12-01 12:28:27 -0500
commit5636626da199811e4be6e848e46edccb17950d3a (patch)
tree05142bf18baf76dd84c2351da390e86b49aeceb9 /ale_linters/ruby/rubocop.vim
parentf5a4e1189480170f70a252b0b4e697763f19a0e8 (diff)
downloadale-5636626da199811e4be6e848e46edccb17950d3a.zip
Add options variable for ruby-rubocop
Diffstat (limited to 'ale_linters/ruby/rubocop.vim')
-rw-r--r--ale_linters/ruby/rubocop.vim10
1 files changed, 9 insertions, 1 deletions
diff --git a/ale_linters/ruby/rubocop.vim b/ale_linters/ruby/rubocop.vim
index fcc6f8bd..a7ed1f99 100644
--- a/ale_linters/ruby/rubocop.vim
+++ b/ale_linters/ruby/rubocop.vim
@@ -34,10 +34,18 @@ function! ale_linters#ruby#rubocop#Handle(buffer, lines)
return l:output
endfunction
+" Set this option to change Rubocop options.
+if !exists('g:ale_ruby_rubocop_options')
+ " let g:ale_ruby_rubocop_options = '--lint'
+ let g:ale_ruby_rubocop_options = ''
+endif
+
call ale#linter#Define('ruby', {
\ 'name': 'rubocop',
\ 'executable': 'rubocop',
-\ 'command': 'rubocop --format emacs --stdin _',
+\ 'command': 'rubocop --format emacs --stdin '
+\ . g:ale_ruby_rubocop_options
+\ . ' _',
\ 'callback': 'ale_linters#ruby#rubocop#Handle',
\})