summaryrefslogtreecommitdiff
path: root/ale_linters/go/gotype.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-03-18 17:16:13 +0000
committerw0rp <devw0rp@gmail.com>2018-03-18 17:16:13 +0000
commitc112ee9dff2a44d733556dc9440f6d1c15f41f15 (patch)
tree736996783bdba392895f05484e2cd6efec71d810 /ale_linters/go/gotype.vim
parentbdd8d2399f59f32c5531d168a1f9402d42d9b299 (diff)
downloadale-c112ee9dff2a44d733556dc9440f6d1c15f41f15.zip
Fix #1392 - Only check files on disk for gotype
Diffstat (limited to 'ale_linters/go/gotype.vim')
-rw-r--r--ale_linters/go/gotype.vim22
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