From 9e09b7ca3559e2c14ed2401bb666b441b22dafff Mon Sep 17 00:00:00 2001 From: Ryan Rosenblum Date: Fri, 24 Aug 2018 11:33:59 -0400 Subject: Update all Ruby linters to work consistently with bundler --- ale_linters/ruby/reek.vim | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'ale_linters/ruby/reek.vim') diff --git a/ale_linters/ruby/reek.vim b/ale_linters/ruby/reek.vim index aa5d8d70..26a26a13 100644 --- a/ale_linters/ruby/reek.vim +++ b/ale_linters/ruby/reek.vim @@ -3,6 +3,14 @@ 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#GetExecutable(buffer) abort + let l:executable = ale#Var(a:buffer, 'ruby_reek_executable') + + return ale#handlers#ruby#EscapeExecutable(l:executable, 'reek') +endfunction function! ale_linters#ruby#reek#VersionCheck(buffer) abort " If we have previously stored the version number in a cache, then @@ -12,18 +20,22 @@ function! ale_linters#ruby#reek#VersionCheck(buffer) abort return '' endif - return 'reek --version' + let l:executable = ale_linters#ruby#reek#GetExecutable(a:buffer) + + return l:executable . ' --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_linters#ruby#reek#GetExecutable(a:buffer) " 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 l:executable + \ . ' -f json --no-progress --no-color' \ . l:display_name_args endfunction @@ -62,7 +74,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'}, -- cgit v1.2.3 From 5c86ffd321ee42b2c59e8455710474e3c13d3e09 Mon Sep 17 00:00:00 2001 From: w0rp Date: Fri, 14 Sep 2018 13:24:59 +0100 Subject: Return only the unescaped executables from executable callbacks --- ale_linters/ruby/reek.vim | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'ale_linters/ruby/reek.vim') diff --git a/ale_linters/ruby/reek.vim b/ale_linters/ruby/reek.vim index 26a26a13..eefc4ecf 100644 --- a/ale_linters/ruby/reek.vim +++ b/ale_linters/ruby/reek.vim @@ -6,12 +6,6 @@ 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#GetExecutable(buffer) abort - let l:executable = ale#Var(a:buffer, 'ruby_reek_executable') - - return ale#handlers#ruby#EscapeExecutable(l:executable, 'reek') -endfunction - function! ale_linters#ruby#reek#VersionCheck(buffer) abort " If we have previously stored the version number in a cache, then " don't look it up again. @@ -20,21 +14,22 @@ function! ale_linters#ruby#reek#VersionCheck(buffer) abort return '' endif - let l:executable = ale_linters#ruby#reek#GetExecutable(a:buffer) + let l:executable = ale#Var(a:buffer, 'ruby_reek_executable') - return l:executable . ' --version' + 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_linters#ruby#reek#GetExecutable(a:buffer) + 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 l:executable + return ale#handlers#ruby#EscapeExecutable(l:executable, 'reek') \ . ' -f json --no-progress --no-color' \ . l:display_name_args endfunction -- cgit v1.2.3 From 9c3daf3a66b00ce553191cb976ff5bb313048553 Mon Sep 17 00:00:00 2001 From: Steven Harman Date: Tue, 16 Oct 2018 13:37:39 -0400 Subject: Respect configured excluded_paths --- ale_linters/ruby/reek.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ale_linters/ruby/reek.vim') diff --git a/ale_linters/ruby/reek.vim b/ale_linters/ruby/reek.vim index eefc4ecf..53363d31 100644 --- a/ale_linters/ruby/reek.vim +++ b/ale_linters/ruby/reek.vim @@ -30,7 +30,7 @@ function! ale_linters#ruby#reek#GetCommand(buffer, version_output) abort \ : '' return ale#handlers#ruby#EscapeExecutable(l:executable, 'reek') - \ . ' -f json --no-progress --no-color' + \ . ' -f json --no-progress --no-color --force-exclusion' \ . l:display_name_args endfunction -- cgit v1.2.3