diff options
Diffstat (limited to 'ale_linters/go')
-rw-r--r-- | ale_linters/go/gotype.vim | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/ale_linters/go/gotype.vim b/ale_linters/go/gotype.vim index 731f4c92..13055a89 100644 --- a/ale_linters/go/gotype.vim +++ b/ale_linters/go/gotype.vim @@ -1,23 +1,19 @@ " Author: Jelte Fennema <github-public@jeltef.nl> " Description: gotype for Go files +function! ale_linters#go#gotype#GetCommand(buffer) abort + if expand('#' . a:buffer . ':p') =~# '_test\.go$' + return + endif + + return 'gotype %s' +endfunction + call ale#linter#Define('go', { \ 'name': 'gotype', \ 'output_stream': 'stderr', \ 'executable': 'gotype', \ 'command_callback': 'ale_linters#go#gotype#GetCommand', \ 'callback': 'ale#handlers#unix#HandleAsError', +\ 'lint_file': 1, \}) - -"\ 'command': -function! ale_linters#go#gotype#GetCommand(buffer) abort - let l:cur_file = expand('#' . a:buffer . ':p') - if l:cur_file =~# '_test\.go$' - return - endif - - let l:module_files = globpath(expand('#' . a:buffer . ':p:h'), '*.go', 0, 1) - let l:other_module_files = filter(l:module_files, 'v:val isnot# ' . ale#util#EscapeVim(l:cur_file) . ' && v:val !~# "_test\.go$"') - return 'gotype %t ' . join(map(l:other_module_files, 'ale#Escape(v:val)')) - -endfunction |