Skip to content

Commit ad8a62a

Browse files
committed
lint: update to golangci-lint/v2
Fixes #3707
1 parent 1d641b7 commit ad8a62a

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

autoload/go/config.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ endfunction
262262
function! go#config#MetalinterEnabled() abort
263263
let l:default = []
264264
if get(g:, 'go_metalinter_command', s:default_metalinter) == 'golangci-lint'
265-
let l:default = ['vet', 'revive', 'errcheck']
265+
let l:default = ['govet', 'revive', 'errcheck']
266266
endif
267267

268268
return get(g:, 'go_metalinter_enabled', l:default)

autoload/go/lint.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,15 +423,16 @@ endfunction
423423
function! s:golangcilintcmd(bin_path, haslinter)
424424
let l:cmd = [a:bin_path]
425425
let l:cmd += ["run"]
426-
let l:cmd += ["--print-issued-lines=false"]
426+
let l:cmd += ["--show-stats=false"]
427+
let l:cmd += ["--output.text.print-issued-lines=false"]
427428
let l:cmd += ['--build-tags', go#config#BuildTags()]
428429
" do not use the default exclude patterns, because doing so causes golint
429430
" problems about missing doc strings to be ignored and other things that
430431
" golint identifies.
431-
let l:cmd += ["--exclude-use-default=false"]
432+
"let l:cmd += ["--exclude-use-default=false"]
432433

433434
if a:haslinter
434-
let l:cmd += ["--disable-all"]
435+
let l:cmd += ["--default=none"]
435436
endif
436437

437438
return l:cmd

doc/vim-go.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ window. The list to use can be set using |'g:go_list_type_commands'|.
15111511
*'g:go_metalinter_autosave_enabled'*
15121512

15131513
Specifies the enabled linters for auto |:GoMetaLinter| on save. When the
1514-
metalinter is `golangci-lint`, if any are enabled, `--disable-all` will be
1514+
metalinter is `golangci-lint`, if any are enabled, `--default=none` will be
15151515
sent to the metalinter.
15161516

15171517
When `g:go_metalinter_command` is set to `staticcheck`, the default value is
@@ -1522,12 +1522,12 @@ an empty list; `staticcheck`'s `-checks` flag will not be used.
15221522

15231523
When `g:go_metalinter_command is set to `golangci-lint`, the default value is
15241524
>
1525-
let g:go_metalinter_autosave_enabled = ['vet', 'revive']
1525+
let g:go_metalinter_autosave_enabled = ['govet', 'revive']
15261526
<
15271527
*'g:go_metalinter_enabled'*
15281528

15291529
Specifies the linters to enable for the |:GoMetaLinter| command. For
1530-
`golangci-lint`, if any are enabled, `--disable-all` will be passed to the
1530+
`golangci-lint`, if any are enabled, `--default=none` will be passed to the
15311531
metalinter.
15321532

15331533
When `g:go_metalinter_command` is set to `staticcheck`, the default value is
@@ -1539,7 +1539,7 @@ an empty list; `staticcheck`'s `-checks` flag will not be used.
15391539
When `g:go_metalinter_command` is set to `golangci-lint`, the default value
15401540
is
15411541
>
1542-
let g:go_metalinter_enabled = ['vet', 'revive', 'errcheck']
1542+
let g:go_metalinter_enabled = ['govet', 'revive', 'errcheck']
15431543
<
15441544
*'g:go_metalinter_command'*
15451545

plugin/go.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ let s:packages = {
4848
\ 'goimports': ['golang.org/x/tools/cmd/goimports@master'],
4949
\ 'revive': ['github.com/mgechev/revive@latest'],
5050
\ 'gopls': ['golang.org/x/tools/gopls@latest', {}, {'after': function('go#lsp#Restart', [])}],
51-
\ 'golangci-lint': ['github.com/golangci/golangci-lint/cmd/golangci-lint@latest'],
51+
\ 'golangci-lint': ['github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest'],
5252
\ 'staticcheck': ['honnef.co/go/tools/cmd/staticcheck@latest'],
5353
\ 'gomodifytags': ['github.com/fatih/gomodifytags@latest'],
5454
\ 'gotags': ['github.com/jstemmer/gotags@master'],

0 commit comments

Comments
 (0)