summaryrefslogtreecommitdiff
path: root/ale_linters/go/gotype.vim
blob: 6a5149cac36335246a3f6d3e259381b135879269 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
" 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 ale#path#BufferCdString(a:buffer) . ' '
    \   . ale#go#EnvString(a:buffer) . 'gotype -e .'
endfunction

call ale#linter#Define('go', {
\   'name': 'gotype',
\   'output_stream': 'stderr',
\   'executable': 'gotype',
\   'command': function('ale_linters#go#gotype#GetCommand'),
\   'callback': 'ale#handlers#go#Handler',
\   'lint_file': 1,
\})