diff options
Diffstat (limited to 'ale_linters/ruby/rails_best_practices.vim')
-rw-r--r-- | ale_linters/ruby/rails_best_practices.vim | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ale_linters/ruby/rails_best_practices.vim b/ale_linters/ruby/rails_best_practices.vim index 4ba1f3fe..9330c03f 100644 --- a/ale_linters/ruby/rails_best_practices.vim +++ b/ale_linters/ruby/rails_best_practices.vim @@ -23,15 +23,13 @@ function! ale_linters#ruby#rails_best_practices#Handle(buffer, lines) abort endfunction function! ale_linters#ruby#rails_best_practices#GetExecutable(buffer) abort - return ale#Var(a:buffer, 'ruby_rails_best_practices_executable') + let l:executable = ale#Var(a:buffer, 'ruby_rails_best_practices_executable') + + return ale#handlers#ruby#EscapeExecutable(l:executable, 'rails_best_practices') endfunction function! ale_linters#ruby#rails_best_practices#GetCommand(buffer) abort let l:executable = ale_linters#ruby#rails_best_practices#GetExecutable(a:buffer) - let l:exec_args = l:executable =~? 'bundle$' - \ ? ' exec rails_best_practices' - \ : '' - let l:rails_root = ale#ruby#FindRailsRoot(a:buffer) if l:rails_root is? '' @@ -41,7 +39,7 @@ function! ale_linters#ruby#rails_best_practices#GetCommand(buffer) abort let l:output_file = ale#Has('win32') ? '%t ' : '/dev/stdout ' let l:cat_file = ale#Has('win32') ? '; type %t' : '' - return ale#Escape(l:executable) . l:exec_args + return l:executable \ . ' --silent -f json --output-file ' . l:output_file \ . ale#Var(a:buffer, 'ruby_rails_best_practices_options') \ . ale#Escape(l:rails_root) @@ -50,7 +48,7 @@ endfunction call ale#linter#Define('ruby', { \ 'name': 'rails_best_practices', -\ 'executable_callback': 'ale_linters#ruby#rails_best_practices#GetExecutable', +\ 'executable_callback': ale#VarFunc('ruby_rails_best_practices_executable'), \ 'command_callback': 'ale_linters#ruby#rails_best_practices#GetCommand', \ 'callback': 'ale_linters#ruby#rails_best_practices#Handle', \ 'lint_file': 1, |