summaryrefslogtreecommitdiff
path: root/ale_linters/ruby/reek.vim
diff options
context:
space:
mode:
authorBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
committerBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
commitd2b0ae8108b2ee395d4eb43c49d68b322a023a30 (patch)
treebb8145e69bf1bcb8968b29cb1a68c47ceb83674d /ale_linters/ruby/reek.vim
parentef641dda80f45cb979bc93c2513c6e10cbd8e42a (diff)
parent0a384a49d371838903d8401c5358ec60f3f4266d (diff)
downloadale-d2b0ae8108b2ee395d4eb43c49d68b322a023a30.zip
Merge branch 'master' into sridhars
Diffstat (limited to 'ale_linters/ruby/reek.vim')
-rw-r--r--ale_linters/ruby/reek.vim13
1 files changed, 10 insertions, 3 deletions
diff --git a/ale_linters/ruby/reek.vim b/ale_linters/ruby/reek.vim
index aa5d8d70..53363d31 100644
--- a/ale_linters/ruby/reek.vim
+++ b/ale_linters/ruby/reek.vim
@@ -3,6 +3,8 @@
call ale#Set('ruby_reek_show_context', 0)
call ale#Set('ruby_reek_show_wiki_link', 0)
+call ale#Set('ruby_reek_options', '')
+call ale#Set('ruby_reek_executable', 'reek')
function! ale_linters#ruby#reek#VersionCheck(buffer) abort
" If we have previously stored the version number in a cache, then
@@ -12,18 +14,23 @@ function! ale_linters#ruby#reek#VersionCheck(buffer) abort
return ''
endif
- return 'reek --version'
+ let l:executable = ale#Var(a:buffer, 'ruby_reek_executable')
+
+ return ale#handlers#ruby#EscapeExecutable(l:executable, 'reek')
+ \ . ' --version'
endfunction
function! ale_linters#ruby#reek#GetCommand(buffer, version_output) abort
let l:version = ale#semver#GetVersion('reek', a:version_output)
+ let l:executable = ale#Var(a:buffer, 'ruby_reek_executable')
" Tell reek what the filename is if the version of reek is new enough.
let l:display_name_args = ale#semver#GTE(l:version, [5, 0, 0])
\ ? ' --stdin-filename %s'
\ : ''
- return 'reek -f json --no-progress --no-color'
+ return ale#handlers#ruby#EscapeExecutable(l:executable, 'reek')
+ \ . ' -f json --no-progress --no-color --force-exclusion'
\ . l:display_name_args
endfunction
@@ -62,7 +69,7 @@ endfunction
call ale#linter#Define('ruby', {
\ 'name': 'reek',
-\ 'executable': 'reek',
+\ 'executable_callback': ale#VarFunc('ruby_reek_executable'),
\ 'command_chain': [
\ {'callback': 'ale_linters#ruby#reek#VersionCheck'},
\ {'callback': 'ale_linters#ruby#reek#GetCommand'},