2017-04-29 16:33:18 +00:00
|
|
|
Before:
|
|
|
|
runtime ale_linters/go/gometalinter.vim
|
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute (The gometalinter handler should handle names with spaces):
|
|
|
|
" We can't test Windows paths with the path resovling on Linux, but we can
|
|
|
|
" test the regex.
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ [
|
|
|
|
\ 'C:\something\file with spaces.go',
|
|
|
|
\ '12',
|
|
|
|
\ '3',
|
|
|
|
\ 'warning',
|
|
|
|
\ 'expected ''package'', found ''IDENT'' gibberish (staticcheck)',
|
|
|
|
\ ],
|
|
|
|
\ [
|
|
|
|
\ 'C:\something\file with spaces.go',
|
|
|
|
\ '37',
|
|
|
|
\ '5',
|
|
|
|
\ 'error',
|
|
|
|
\ 'expected ''package'', found ''IDENT'' gibberish (golint)',
|
|
|
|
\ ],
|
|
|
|
\ ],
|
|
|
|
\ map(ale_linters#go#gometalinter#GetMatches([
|
|
|
|
\ 'C:\something\file with spaces.go:12:3:warning: expected ''package'', found ''IDENT'' gibberish (staticcheck)',
|
|
|
|
\ 'C:\something\file with spaces.go:37:5:error: expected ''package'', found ''IDENT'' gibberish (golint)',
|
|
|
|
\ ]), 'v:val[1:5]')
|
|
|
|
|
2017-12-04 18:42:36 +00:00
|
|
|
Execute (The gometalinter handler should handle paths correctly):
|
|
|
|
call ale#test#SetFilename('app/test.go')
|
|
|
|
|
|
|
|
let file = ale#path#GetAbsPath(expand('%:p:h'), 'test.go')
|
2017-04-29 16:33:18 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 12,
|
|
|
|
\ 'col': 3,
|
|
|
|
\ 'text': 'expected ''package'', found ''IDENT'' gibberish (staticcheck)',
|
|
|
|
\ 'type': 'W',
|
2017-12-19 18:23:09 +00:00
|
|
|
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
|
2017-04-29 16:33:18 +00:00
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 37,
|
|
|
|
\ 'col': 5,
|
|
|
|
\ 'text': 'expected ''package'', found ''IDENT'' gibberish (golint)',
|
|
|
|
\ 'type': 'E',
|
2017-12-19 18:23:09 +00:00
|
|
|
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
|
2017-04-29 16:33:18 +00:00
|
|
|
\ },
|
|
|
|
\ ],
|
2017-05-15 19:43:55 +00:00
|
|
|
\ ale_linters#go#gometalinter#Handler(bufnr(''), [
|
2017-12-04 18:42:36 +00:00
|
|
|
\ file . ':12:3:warning: expected ''package'', found ''IDENT'' gibberish (staticcheck)',
|
|
|
|
\ file . ':37:5:error: expected ''package'', found ''IDENT'' gibberish (golint)',
|
2017-04-29 16:33:18 +00:00
|
|
|
\ ])
|