Nimbin[12]?Mirrors & Forks / syntastic / commits / 97bf9ec7

syntastic git · master

syntastic vim plugin (fork)

vim fork · first commit 2009-07-10 · last commit 2022-07-10 (4 years ago) · synced 3 days ago · upstream: github.com/vim-syntastic/syntastic

Vim Script 99%
git clone https://git.christianimmanuel.de/mirrors-forks/syntastic.gitwget https://git.christianimmanuel.de/mirrors-forks/syntastic/archive/syntastic.tar.gz

Checker go/golangci_lint: add cwd parameters

wudongxue · 2021-09-03 11:29 · 97bf9ec720662af51ae403b6dfe720d4a24bfcbc

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