diff options
author | Andrey Popp <8mayday@gmail.com> | 2018-11-04 20:10:36 +0300 |
---|---|---|
committer | Andrey Popp <8mayday@gmail.com> | 2018-11-04 20:32:56 +0300 |
commit | b9fb62a4cd302486914403e41676e78b4cfdf0e3 (patch) | |
tree | ad4e2fb5c744c0ca983fd95f641344ff546d6b64 /test/fixers | |
parent | acdc99b94daf0f14a8a71d1de5656e9f612a0139 (diff) | |
download | ale-b9fb62a4cd302486914403e41676e78b4cfdf0e3.zip |
Make ocamlformat work without temporary files
Problem: ocamlformat is configured to format files in-place and thus go
via creating a temporary file for that. Because temporary file resides
in a different directory ocamlformat can't find `.ocamlformat`
configuration files in an original location of source files.
Solution: ocamlformat since version 0.8 can read sources on stdin and
spur result on stdout. We reconfigure ocamlformat to use a simpler
interface.
Diffstat (limited to 'test/fixers')
-rw-r--r-- | test/fixers/test_ocamlformat_fixer_callback.vader | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/fixers/test_ocamlformat_fixer_callback.vader b/test/fixers/test_ocamlformat_fixer_callback.vader index d2aee066..f0c36ed7 100644 --- a/test/fixers/test_ocamlformat_fixer_callback.vader +++ b/test/fixers/test_ocamlformat_fixer_callback.vader @@ -18,10 +18,9 @@ Execute(The ocamlformat callback should return the correct default values): AssertEqual \ { - \ 'read_temporary_file': 1, \ 'command': ale#Escape('xxxinvalid') - \ . ' --inplace' - \ . ' %t', + \ . ' --name=' . ale#Escape(bufname(bufnr(''))) + \ . ' -', \ }, \ ale#fixers#ocamlformat#Fix(bufnr('')) @@ -31,10 +30,9 @@ Execute(The ocamlformat callback should include custom ocamlformat options): AssertEqual \ { - \ 'read_temporary_file': 1, \ 'command': ale#Escape('xxxinvalid') \ . ' ' . g:ale_ocaml_ocamlformat_options - \ . ' --inplace' - \ . ' %t', + \ . ' --name=' . ale#Escape(bufname(bufnr(''))) + \ . ' -', \ }, \ ale#fixers#ocamlformat#Fix(bufnr('')) |