mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-03 00:22:51 +08:00
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 <houstdav000@gmail.com> * 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 <houstdav000@gmail.com> * Fix Test Setup Method Capitalization I had put "Setup" instead of "SetUp" for "ale#assert#SetUpFixerTests". Fix such. Signed-off-by: David Houston <houstdav000@gmail.com> * 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 <houstdav000@gmail.com>
This commit is contained in:
27
test/fixers/test_gofumpt_fixer.vader
Normal file
27
test/fixers/test_gofumpt_fixer.vader
Normal file
@@ -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'
|
||||
\}
|
||||
Reference in New Issue
Block a user