summaryrefslogtreecommitdiff
path: root/ale_linters/ruby/brakeman.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-09-14 13:24:59 +0100
committerw0rp <devw0rp@gmail.com>2018-09-14 13:24:59 +0100
commit5c86ffd321ee42b2c59e8455710474e3c13d3e09 (patch)
tree8c6702aa0fe866f1e7d289f76f4b5bd806847f89 /ale_linters/ruby/brakeman.vim
parent9e09b7ca3559e2c14ed2401bb666b441b22dafff (diff)
downloadale-5c86ffd321ee42b2c59e8455710474e3c13d3e09.zip
Return only the unescaped executables from executable callbacks
Diffstat (limited to 'ale_linters/ruby/brakeman.vim')
-rw-r--r--ale_linters/ruby/brakeman.vim15
1 files changed, 4 insertions, 11 deletions
diff --git a/ale_linters/ruby/brakeman.vim b/ale_linters/ruby/brakeman.vim
index 099254a9..122e0b5b 100644
--- a/ale_linters/ruby/brakeman.vim
+++ b/ale_linters/ruby/brakeman.vim
@@ -3,15 +3,7 @@
call ale#Set('ruby_brakeman_options', '')
call ale#Set('ruby_brakeman_executable', 'brakeman')
-
-let g:ale_ruby_brakeman_options =
-\ get(g:, 'ale_ruby_brakeman_options', '')
-
-function! ale_linters#ruby#brakeman#GetExecutable(buffer) abort
- let l:executable = ale#Var(a:buffer, 'ruby_brakeman_executable')
-
- return ale#handlers#ruby#EscapeExecutable(l:executable, 'brakeman')
-endfunction
+call ale#Set('ruby_brakeman_options', '')
function! ale_linters#ruby#brakeman#Handle(buffer, lines) abort
let l:output = []
@@ -36,14 +28,15 @@ function! ale_linters#ruby#brakeman#Handle(buffer, lines) abort
endfunction
function! ale_linters#ruby#brakeman#GetCommand(buffer) abort
- let l:executable = ale_linters#ruby#brakeman#GetExecutable(a:buffer)
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
if l:rails_root is? ''
return ''
endif
- return l:executable
+ let l:executable = ale#Var(a:buffer, 'ruby_brakeman_executable')
+
+ return ale#handlers#ruby#EscapeExecutable(l:executable, 'brakeman')
\ . ' -f json -q '
\ . ale#Var(a:buffer, 'ruby_brakeman_options')
\ . ' -p ' . ale#Escape(l:rails_root)