summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2016-12-02 09:18:18 +0000
committerGitHub <noreply@github.com>2016-12-02 09:18:18 +0000
commit3a1caca907ca889167720a39eef60aa2a762cc18 (patch)
tree05142bf18baf76dd84c2351da390e86b49aeceb9
parentf5a4e1189480170f70a252b0b4e697763f19a0e8 (diff)
parent5636626da199811e4be6e848e46edccb17950d3a (diff)
downloadale-3a1caca907ca889167720a39eef60aa2a762cc18.zip
Merge pull request #195 from mortonfox/rubocop-options
Add options variable for ruby-rubocop
-rw-r--r--ale_linters/ruby/rubocop.vim10
-rw-r--r--doc/ale.txt10
2 files changed, 19 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',
\})
diff --git a/doc/ale.txt b/doc/ale.txt
index 42b746c5..01b23321 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -631,6 +631,16 @@ Python 3, you may want to set >
after making sure it's installed for the appropriate Python versions (e.g.
`python3 -m pip install --user flake8`).
+-------------------------------------------------------------------------------
+4.18. ruby-rubocop *ale-linter-options-ruby-rubocop*
+
+g:ale_ruby_rubocop_options *g:ale_ruby_rubocop_options*
+
+ Type: |String|
+ Default: `''`
+
+ This variable can be change to modify flags given to rubocop.
+
===============================================================================
5. Linter Integration Notes *ale-linter-integration*