summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjhlink <jhlink@users.noreply.github.com>2020-07-26 22:02:32 -0400
committerjhlink <jhlink@users.noreply.github.com>2020-07-26 22:05:14 -0400
commit0e6578cf65a747ab6f8443493374a52b7d9060a8 (patch)
tree506860fd160af0dff4c58e0fa8269146d31a2f07
parent75723e4522a7787c3c5893ffa58ed3dc493c0bbc (diff)
downloadale-0e6578cf65a747ab6f8443493374a52b7d9060a8.zip
fix: Remove explicit calls to file path in astyle
-rw-r--r--autoload/ale/fixers/astyle.vim5
-rw-r--r--test/fixers/test_astyle_fixer_callback.vader8
2 files changed, 7 insertions, 6 deletions
diff --git a/autoload/ale/fixers/astyle.vim b/autoload/ale/fixers/astyle.vim
index f5133eb6..304c2f24 100644
--- a/autoload/ale/fixers/astyle.vim
+++ b/autoload/ale/fixers/astyle.vim
@@ -21,10 +21,11 @@ function! ale#fixers#astyle#Fix(buffer) abort
let l:executable = ale#fixers#astyle#Var(a:buffer, 'executable')
let l:filename = ale#Escape(bufname(a:buffer))
let l:options = ale#fixers#astyle#Var(a:buffer, 'options')
- let l:command = ' --stdin=' . l:filename
+ let l:command = ' --stdin='
return {
- \ 'command': ale#Escape(l:executable) . l:command
+ \ 'command': ale#Escape(l:executable)
\ . (empty(l:options) ? '' : ' --project=' . l:options)
+ \ . l:command
\}
endfunction
diff --git a/test/fixers/test_astyle_fixer_callback.vader b/test/fixers/test_astyle_fixer_callback.vader
index 2cbbcacd..d3520932 100644
--- a/test/fixers/test_astyle_fixer_callback.vader
+++ b/test/fixers/test_astyle_fixer_callback.vader
@@ -20,7 +20,7 @@ Execute(The astyle callback should return the correct default values):
AssertEqual
\ {
\ 'command': ale#Escape(g:ale_c_astyle_executable)
- \ . ' --stdin=' . ale#Escape(targetfile)
+ \ . ' --stdin='
\ },
\ ale#fixers#astyle#Fix(bufnr(''))
@@ -32,7 +32,7 @@ Execute(The astyle callback should support cpp files):
AssertEqual
\ {
\ 'command': ale#Escape(g:ale_cpp_astyle_executable)
- \ . ' --stdin=' . ale#Escape(targetfile)
+ \ . ' --stdin='
\ },
\ ale#fixers#astyle#Fix(bufnr(''))
@@ -45,8 +45,8 @@ Execute(The astyle callback should support cpp files with option file set):
AssertEqual
\ {
\ 'command': ale#Escape('invalidpp')
- \ . ' --stdin=' . ale#Escape(targetfile)
\ . ' --project=' . g:ale_cpp_astyle_options
+ \ . ' --stdin='
\ },
\ ale#fixers#astyle#Fix(bufnr(''))
@@ -59,7 +59,7 @@ Execute(The astyle callback should return the correct default values with an opt
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid')
- \ . ' --stdin=' . ale#Escape(targetfile)
\ . ' --project=' . g:ale_c_astyle_options
+ \ . ' --stdin='
\ },
\ ale#fixers#astyle#Fix(bufnr(''))