From 26005242744c6d88f0ec728964754909f4a73d94 Mon Sep 17 00:00:00 2001 From: Evan Borden Date: Thu, 23 Aug 2018 18:14:59 -0400 Subject: Add stylish-haskell as a fixer (#1837) * Add stylish-haskell as a fixer `stylish-haskell` is a common formatting tool for the haskell toolchain. It is not as advanced as `brittany` or `hindent`, but it is commonly used for formatting of imports and data declarations. This adds it as a fixer in ALE. --- .../test_stylish_haskell_fixer_callback.vader | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/fixers/test_stylish_haskell_fixer_callback.vader (limited to 'test/fixers/test_stylish_haskell_fixer_callback.vader') diff --git a/test/fixers/test_stylish_haskell_fixer_callback.vader b/test/fixers/test_stylish_haskell_fixer_callback.vader new file mode 100644 index 00000000..755d3430 --- /dev/null +++ b/test/fixers/test_stylish_haskell_fixer_callback.vader @@ -0,0 +1,24 @@ +Before: + Save g:ale_haskell_stylish_haskell_executable + + " Use an invalid global executable, so we don't match it. + let g:ale_haskell_stylish_haskell_executable = 'xxxinvalid' + + call ale#test#SetDirectory('/testplugin/test/fixers') + +After: + Restore + + call ale#test#RestoreDirectory() + +Execute(The stylish-haskell callback should return the correct default values): + call ale#test#SetFilename('../haskell_files/testfile.hs') + + AssertEqual + \ { + \ 'read_temporary_file': 1, + \ 'command': ale#Escape('xxxinvalid') + \ . ' --inplace' + \ . ' %t', + \ }, + \ ale#fixers#stylish_haskell#Fix(bufnr('')) -- cgit v1.2.3