summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Lindström <bkhl@elektrubadur.se>2017-12-27 23:03:46 +0700
committerBjörn Lindström <bkhl@elektrubadur.se>2017-12-27 23:12:57 +0700
commitb0eaddadc9b4b99f8f0163a5b55ab4dc0499d238 (patch)
tree088ad0a2949845a98d942a36e772ff7d55df2dc0
parentc165c7c5d11eb827a3be6bab691f20eeb6f6e487 (diff)
downloadale-b0eaddadc9b4b99f8f0163a5b55ab4dc0499d238.zip
Don't use temporary file for rustfmt fixer
rustfmt normally acts on a file in place, and applies configuration from rustfmt.toml files according to the path of the file. Using a temporary file for rustfmt breaks this functionality, so removing the '%t' from the rustfmt command.
-rw-r--r--autoload/ale/fixers/rustfmt.vim4
-rw-r--r--test/fixers/test_rustfmt_fixer_callback.vader8
2 files changed, 3 insertions, 9 deletions
diff --git a/autoload/ale/fixers/rustfmt.vim b/autoload/ale/fixers/rustfmt.vim
index fb5ac61c..38882fbf 100644
--- a/autoload/ale/fixers/rustfmt.vim
+++ b/autoload/ale/fixers/rustfmt.vim
@@ -10,8 +10,6 @@ function! ale#fixers#rustfmt#Fix(buffer) abort
return {
\ 'command': ale#Escape(l:executable)
- \ . (empty(l:options) ? '' : ' ' . l:options)
- \ . ' %t',
- \ 'read_temporary_file': 1,
+ \ . (empty(l:options) ? '' : ' ' . l:options),
\}
endfunction
diff --git a/test/fixers/test_rustfmt_fixer_callback.vader b/test/fixers/test_rustfmt_fixer_callback.vader
index 36dd58a1..95c78dea 100644
--- a/test/fixers/test_rustfmt_fixer_callback.vader
+++ b/test/fixers/test_rustfmt_fixer_callback.vader
@@ -18,9 +18,7 @@ Execute(The rustfmt callback should return the correct default values):
AssertEqual
\ {
- \ 'read_temporary_file': 1,
- \ 'command': ale#Escape('xxxinvalid')
- \ . ' %t',
+ \ 'command': ale#Escape('xxxinvalid'),
\ },
\ ale#fixers#rustfmt#Fix(bufnr(''))
@@ -30,9 +28,7 @@ Execute(The rustfmt callback should include custom rustfmt options):
AssertEqual
\ {
- \ 'read_temporary_file': 1,
\ 'command': ale#Escape('xxxinvalid')
- \ . ' ' . g:ale_rust_rustfmt_options
- \ . ' %t',
+ \ . ' ' . g:ale_rust_rustfmt_options,
\ },
\ ale#fixers#rustfmt#Fix(bufnr(''))