Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Checker go/golangci_lint: add cwd parameters
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wudongxue committed Sep 6, 2021
1 parent 7414f30 commit 97bf9ec
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion syntax_checkers/go/golangci_lint.vim
Expand Up @@ -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
Expand Down

0 comments on commit 97bf9ec

Please sign in to comment.