Skip to content

Commit

Permalink
add g:go_metalinter_config_enabled and g:go_metalinter_grep_new flags
Browse files Browse the repository at this point in the history
  • Loading branch information
micahcoffman committed Mar 20, 2019
1 parent 2461989 commit 85d4505
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions autoload/go/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ function! go#config#Metalinter() abort
return get(g:, "go_metalinter", "gometalinter")
endfunction

function! go#config#MetalinterConfigEnabled() abort
return get(g:, "go_metalinter_config_enabled", 0)
endfunction

function! go#config#MetalinterGrepNew() abort
return get(g:, "go_metalinter_grep_new", 0)
endfunction

function! go#config#MetalinterCommand() abort
return get(g:, "go_metalinter_command", "")
endfunction
Expand Down
9 changes: 8 additions & 1 deletion autoload/go/lint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,14 @@ function! s:golangcilintcmd(bin_path)
let cmd = [a:bin_path]
let cmd += ["run"]
let cmd += ["--print-issued-lines=false"]
let cmd += ["--disable-all"]

if go#config#MetalinterConfigEnabled() == 0
let cmd += ["--no-config"]
let cmd += ["--disable-all"]
if go#config#MetalinterGrepNew() == 1
let cmd += ["--new-from-rev=HEAD~"]
endif

return cmd
endfunction

Expand Down

0 comments on commit 85d4505

Please sign in to comment.