summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fixers/buildifier.vim15
1 files changed, 2 insertions, 13 deletions
diff --git a/autoload/ale/fixers/buildifier.vim b/autoload/ale/fixers/buildifier.vim
index e3dab5e1..b676068d 100644
--- a/autoload/ale/fixers/buildifier.vim
+++ b/autoload/ale/fixers/buildifier.vim
@@ -14,20 +14,9 @@ endfunction
function! ale#fixers#buildifier#Fix(buffer) abort
let l:executable = ale#Escape(ale#fixers#buildifier#GetExecutable(a:buffer))
let l:options = ale#Var(a:buffer, 'bazel_buildifier_options')
- let l:filename = fnamemodify(bufname(a:buffer), ':t')
+ let l:filename = ale#Escape(bufname(a:buffer))
- let l:command = l:executable . ' -mode fix -lint fix'
-
- " Attempt to guess the file type based on the filename. buildifier itself
- " usually does this based on the filenames provided on the command line,
- " but because we're piping our buffer via stdin, we do this manually.
- if l:filename =~? 'WORKSPACE'
- let l:command .= ' -type workspace'
- elseif l:filename =~? 'BUILD'
- let l:command .= ' -type build'
- elseif l:filename =~? '.bzl$'
- let l:command .= ' -type bzl'
- endif
+ let l:command = l:executable . ' -mode fix -lint fix -path ' . l:filename
if l:options isnot# ''
let l:command .= ' ' . l:options