summaryrefslogtreecommitdiff
path: root/autoload
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 /autoload
parent9e09b7ca3559e2c14ed2401bb666b441b22dafff (diff)
downloadale-5c86ffd321ee42b2c59e8455710474e3c13d3e09.zip
Return only the unescaped executables from executable callbacks
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fixers/rubocop.vim7
-rw-r--r--autoload/ale/handlers/rubocop.vim8
2 files changed, 5 insertions, 10 deletions
diff --git a/autoload/ale/fixers/rubocop.vim b/autoload/ale/fixers/rubocop.vim
index 47a78308..a4613817 100644
--- a/autoload/ale/fixers/rubocop.vim
+++ b/autoload/ale/fixers/rubocop.vim
@@ -1,9 +1,12 @@
+call ale#Set('ruby_rubocop_options', '')
+call ale#Set('ruby_rubocop_executable', 'rubocop')
+
function! ale#fixers#rubocop#GetCommand(buffer) abort
- let l:executable = ale#handlers#rubocop#GetExecutable(a:buffer)
+ let l:executable = ale#Var(a:buffer, 'ruby_rubocop_executable')
let l:config = ale#path#FindNearestFile(a:buffer, '.rubocop.yml')
let l:options = ale#Var(a:buffer, 'ruby_rubocop_options')
- return l:executable
+ return ale#handlers#ruby#EscapeExecutable(l:executable, 'rubocop')
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --auto-correct %t'
diff --git a/autoload/ale/handlers/rubocop.vim b/autoload/ale/handlers/rubocop.vim
deleted file mode 100644
index 09af7085..00000000
--- a/autoload/ale/handlers/rubocop.vim
+++ /dev/null
@@ -1,8 +0,0 @@
-call ale#Set('ruby_rubocop_options', '')
-call ale#Set('ruby_rubocop_executable', 'rubocop')
-
-function! ale#handlers#rubocop#GetExecutable(buffer) abort
- let l:executable = ale#Var(a:buffer, 'ruby_rubocop_executable')
-
- return ale#handlers#ruby#EscapeExecutable(l:executable, 'rubocop')
-endfunction