diff options
| author | Timo Furrer <tuxtimo@gmail.com> | 2026-01-27 14:25:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-27 08:25:39 -0500 |
| commit | 86a933b808c05df6f1422c4d134f5e9c518930b3 (patch) | |
| tree | da24c8b209b55d370d3ea4a0fa7d9cd93b0b9dd7 /lua | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-86a933b808c05df6f1422c4d134f5e9c518930b3.tar nvim-lspconfig-86a933b808c05df6f1422c4d134f5e9c518930b3.tar.gz nvim-lspconfig-86a933b808c05df6f1422c4d134f5e9c518930b3.tar.bz2 nvim-lspconfig-86a933b808c05df6f1422c4d134f5e9c518930b3.tar.lz nvim-lspconfig-86a933b808c05df6f1422c4d134f5e9c518930b3.tar.xz nvim-lspconfig-86a933b808c05df6f1422c4d134f5e9c518930b3.tar.zst nvim-lspconfig-86a933b808c05df6f1422c4d134f5e9c518930b3.zip | |
fix(golangci_lint_ls): disable all output formats except JSON #4247
This change set enables all possible output formats that exist for
golangci-lint. This is necessary because if a user configures output
formats in their `.golangci.yml` configuration (for example for CI) then
this is always in addition to the ones enabled on the command line.
Therefore, we manually disable all possible output formats.
Currently, there doesn't exist a `golangci-lint` option to exclusively
enable an output format or disable all from the config.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/configs/golangci_lint_ls.lua | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lua/lspconfig/configs/golangci_lint_ls.lua b/lua/lspconfig/configs/golangci_lint_ls.lua index 5e822206..109933d4 100644 --- a/lua/lspconfig/configs/golangci_lint_ls.lua +++ b/lua/lspconfig/configs/golangci_lint_ls.lua @@ -12,7 +12,22 @@ return { cmd = { 'golangci-lint-langserver' }, filetypes = { 'go', 'gomod' }, init_options = { - command = { 'golangci-lint', 'run', '--output.json.path=stdout', '--show-stats=false' }, + command = { + 'golangci-lint', + 'run', + -- disable all output formats that might be enabled by the users .golangci.yml + '--output.text.path=', + '--output.tab.path=', + '--output.html.path=', + '--output.checkstyle.path=', + '--output.junit-xml.path=', + '--output.teamcity.path=', + '--output.sarif.path=', + -- disable stats output + '--show-stats=false', + -- enable JSON output to be used by the language server + '--output.json.path=stdout', + }, }, root_dir = function(fname) return util.root_pattern( |
