From 8b3b16d71c4c683da6f3ca39662d207a3e894901 Mon Sep 17 00:00:00 2001 From: David Houston Date: Tue, 9 Nov 2021 02:53:44 -0500 Subject: Implement gofumpt Fixer (#3968) * Implement gofumpt Fixer Add an implementation with test and documentation for the gofumpt go code formatter, a stricter formatter than your standard "go fmt". Signed-off-by: David Houston * Add gofumpt to ale.txt TOC Forgot to add gofumpt to the ALE vim help Table of Contents, so do so. Signed-off-by: David Houston * Fix Test Setup Method Capitalization I had put "Setup" instead of "SetUp" for "ale#assert#SetUpFixerTests". Fix such. Signed-off-by: David Houston * Fix typos Add a missing space, remove an extra bracket by actually running tests locally first. Would've been smart to do that from the beginning... Signed-off-by: David Houston --- test/fixers/test_gofumpt_fixer.vader | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/fixers/test_gofumpt_fixer.vader (limited to 'test') diff --git a/test/fixers/test_gofumpt_fixer.vader b/test/fixers/test_gofumpt_fixer.vader new file mode 100644 index 00000000..63e04de8 --- /dev/null +++ b/test/fixers/test_gofumpt_fixer.vader @@ -0,0 +1,27 @@ +Before: + call ale#assert#SetUpFixerTest('go', 'gofumpt') + +After: + call ale#assert#TearDownFixerTest() + +Execute(The gofumpt callback should return the correct default values): + AssertFixer { + \ 'read_temporary_file': 1, + \ 'command': ale#Escape('gofumpt') . ' -w -- %t' + \} + +Execute(The gofumpt callback should allow custom gofumpt executables): + let g:ale_go_gofumpt_executable = 'foo/bar' + + AssertFixer { + \ 'read_temporary_file': 1, + \ 'command': ale#Escape('foo/bar') . ' -w -- %t' + \} + +Execute(The gofumpt callback should allow custom gofumpt options): + let g:ale_go_gofumpt_options = '--foobar' + + AssertFixer { + \ 'read_temporary_file': 1, + \ 'command': ale#Escape('gofumpt') . ' --foobar -w -- %t' + \} -- cgit v1.2.3