diff --git a/autoload/go/config.vim b/autoload/go/config.vim index 5435cac488..204bf590ff 100644 --- a/autoload/go/config.vim +++ b/autoload/go/config.vim @@ -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 diff --git a/autoload/go/lint.vim b/autoload/go/lint.vim index 8643c86ae7..418de412b0 100644 --- a/autoload/go/lint.vim +++ b/autoload/go/lint.vim @@ -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