2018-03-31 10:55:20 -04:00
|
|
|
" Author: Jelte Fennema <github-public@jeltef.nl>
|
|
|
|
" Description: gotype for Go files
|
|
|
|
|
2021-05-05 04:25:00 -04:00
|
|
|
function! ale_linters#go#gotype#GetExecutable(buffer) abort
|
2018-03-31 10:55:20 -04:00
|
|
|
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
|
2018-07-19 08:52:53 -04:00
|
|
|
return ''
|
2018-03-31 10:55:20 -04:00
|
|
|
endif
|
|
|
|
|
2021-05-05 04:25:00 -04:00
|
|
|
return 'gotype'
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! ale_linters#go#gotype#GetCommand(buffer) abort
|
|
|
|
return ale#go#EnvString(a:buffer) . 'gotype -e .'
|
2018-03-31 10:55:20 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('go', {
|
|
|
|
\ 'name': 'gotype',
|
|
|
|
\ 'output_stream': 'stderr',
|
2021-05-05 04:25:00 -04:00
|
|
|
\ 'executable': function('ale_linters#go#gotype#GetExecutable'),
|
|
|
|
\ 'cwd': '%s:h',
|
2019-03-08 06:04:56 -05:00
|
|
|
\ 'command': function('ale_linters#go#gotype#GetCommand'),
|
2018-03-31 10:55:20 -04:00
|
|
|
\ 'callback': 'ale#handlers#go#Handler',
|
|
|
|
\ 'lint_file': 1,
|
|
|
|
\})
|