Skip to content

Commit cb03c97

Browse files
authored
Merge pull request #58 from nametake/v2-readme
feat: update golangci-lint params for v2 compatibility
2 parents 297d6f0 + cd88f9d commit cb03c97

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ coc-settings.json
3737
"command": "golangci-lint-langserver",
3838
"filetypes": ["go"],
3939
"initializationOptions": {
40-
"command": ["golangci-lint", "run", "--out-format", "json", "--issues-exit-code=1"]
41-
}
40+
"command": ["golangci-lint", "run", "--output.json.path", "stdout", "--show-stats=false", "--issues-exit-code=1"]
4241
}
4342
}
4443
}
@@ -52,7 +51,7 @@ augroup vim_lsp_golangci_lint_langserver
5251
autocmd User lsp_setup call lsp#register_server({
5352
\ 'name': 'golangci-lint-langserver',
5453
\ 'cmd': {server_info->['golangci-lint-langserver']},
55-
\ 'initialization_options': {'command': ['golangci-lint', 'run', '--out-format', 'json', '--issues-exit-code=1']},
54+
\ 'initialization_options': {'command': ['golangci-lint', 'run', '--output.json.path', 'stdout', '--show-stats=false', '--issues-exit-code=1']},
5655
\ 'whitelist': ['go'],
5756
\ })
5857
augroup END
@@ -74,8 +73,7 @@ if not configs.golangcilsp then
7473
cmd = {'golangci-lint-langserver'},
7574
root_dir = lspconfig.util.root_pattern('.git', 'go.mod'),
7675
init_options = {
77-
command = { "golangci-lint", "run", "--out-format", "json", "--issues-exit-code=1" };
78-
}
76+
command = { "golangci-lint", "run", "--output.json.path", "stdout", "--show-stats=false", "--issues-exit-code=1" };
7977
};
8078
}
8179
end
@@ -106,5 +104,10 @@ language-servers = [ "gopls", "golangci-lint-lsp" ]
106104
command = "golangci-lint-langserver"
107105

108106
[language-server.golangci-lint-lsp.config]
109-
command = ["golangci-lint", "run", "--out-format", "json", "--issues-exit-code=1"]
107+
command = ["golangci-lint", "run", "--output.json.path", "stdout", "--show-stats=false", "--issues-exit-code=1"]
110108
```
109+
110+
## golangci-lint Version Compatibility
111+
112+
- For golangci-lint v2+: Use `--output.json.path stdout --show-stats=false` parameters
113+
- For golangci-lint v1: Use `--out-format json` parameter

0 commit comments

Comments
 (0)