syntastic git · master
syntastic vim plugin (fork)
Vim Script 99%git clone https://git.christianimmanuel.de/mirrors-forks/syntastic.gitwget https://git.christianimmanuel.de/mirrors-forks/syntastic/archive/syntastic.tar.gzChecker go/golangci_lint: add cwd parameters
Some linters("typecheck", "lll") need pacakge path to work.
These linters were supported by golangci-lint, however can't work
correctly in Syntastic with lacking of package path.syntax_checkers/go/golangci_lint.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/syntax_checkers/go/golangci_lint.vim b/syntax_checkers/go/golangci_lint.vim index 2c885fa5..d3aea945 100644 --- a/syntax_checkers/go/golangci_lint.vim +++ b/syntax_checkers/go/golangci_lint.vim @@ -19,15 +19,21 @@ let s:save_cpo = &cpo set cpo&vim function! SyntaxCheckers_go_golangci_lint_GetLocList() dict - let makeprg = self.makeprgBuild({ 'args_before': 'run' }) + let buf = bufnr('') + + let makeprg = self.makeprgBuild({ + \ 'args_before': 'run', + \ 'fname': '.' }) let errorformat = \ '%f:%l:%c: %m,' . + \ '%f:%l: %m,' . \ '%-G%.%#' return SyntasticMake({ \ 'makeprg': makeprg, \ 'errorformat': errorformat, + \ 'cwd': fnamemodify(bufname(buf), ':p:h'), \ 'defaults': {'type': 'e'}, \ 'subtype': 'Style' }) endfunction