From c112ee9dff2a44d733556dc9440f6d1c15f41f15 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 18 Mar 2018 17:16:13 +0000 Subject: Fix #1392 - Only check files on disk for gotype --- ale_linters/go/gotype.vim | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'ale_linters/go') 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 " 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 -- cgit v1.2.3