From 61248e1453dc6373160154e1f6855ffc510a7dfc Mon Sep 17 00:00:00 2001 From: Pat Brisbin Date: Sat, 22 Apr 2023 09:05:50 -0400 Subject: Add fourmolu fixer (#4501) * Add fourmolu fixer Fourmolu is aversion of Ormolu that supports configuration. This fixer was modeled after the Ormolu one, but using the "stack executable" approach of the Brittany and Stylish Haskell fixers. * Sort supported-tools.md --- test/fixers/test_fourmolu_fixer_callback.vader | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/fixers/test_fourmolu_fixer_callback.vader (limited to 'test/fixers') diff --git a/test/fixers/test_fourmolu_fixer_callback.vader b/test/fixers/test_fourmolu_fixer_callback.vader new file mode 100644 index 00000000..728c02ed --- /dev/null +++ b/test/fixers/test_fourmolu_fixer_callback.vader @@ -0,0 +1,29 @@ +Before: + Save g:ale_haskell_fourmolu_executable + Save g:ale_haskell_fourmolu_options + +After: + Restore + +Execute(The fourmolu callback should return the correct default values): + AssertEqual + \ { + \ 'command': ale#Escape('fourmolu') + \ . ' --stdin-input-file ' + \ . ale#Escape(@%) + \ }, + \ ale#fixers#fourmolu#Fix(bufnr('')) + +Execute(The fourmolu executable and options should be configurable): + let g:ale_haskell_fourmolu_executable = '/path/to/fourmolu' + let g:ale_haskell_fourmolu_options = '-h' + + AssertEqual + \ { + \ 'command': ale#Escape('/path/to/fourmolu') + \ . ' -h' + \ . ' --stdin-input-file ' + \ . ale#Escape(@%) + \ }, + \ ale#fixers#fourmolu#Fix(bufnr('')) + -- cgit v1.2.3