diff options
| author | ALX99 <46844683+ALX99@users.noreply.github.com> | 2023-04-25 08:48:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-25 14:48:58 +0800 |
| commit | 9b3d06eb75d10d0895440f8ea45c74fc14dde117 (patch) | |
| tree | 94750e4d6b88beae0a67bff03e2e5cd3543bfb99 /lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-9b3d06eb75d10d0895440f8ea45c74fc14dde117.tar nvim-lspconfig-9b3d06eb75d10d0895440f8ea45c74fc14dde117.tar.gz nvim-lspconfig-9b3d06eb75d10d0895440f8ea45c74fc14dde117.tar.bz2 nvim-lspconfig-9b3d06eb75d10d0895440f8ea45c74fc14dde117.tar.lz nvim-lspconfig-9b3d06eb75d10d0895440f8ea45c74fc14dde117.tar.xz nvim-lspconfig-9b3d06eb75d10d0895440f8ea45c74fc14dde117.tar.zst nvim-lspconfig-9b3d06eb75d10d0895440f8ea45c74fc14dde117.zip | |
fix(golangci_lint): root_pattern should look for all supported cfg files (#2574)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/golangci_lint_ls.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lua/lspconfig/server_configurations/golangci_lint_ls.lua b/lua/lspconfig/server_configurations/golangci_lint_ls.lua index 21ed58f3..b1b51c49 100644 --- a/lua/lspconfig/server_configurations/golangci_lint_ls.lua +++ b/lua/lspconfig/server_configurations/golangci_lint_ls.lua @@ -8,7 +8,15 @@ return { command = { 'golangci-lint', 'run', '--out-format', 'json' }, }, root_dir = function(fname) - return util.root_pattern 'go.work'(fname) or util.root_pattern('go.mod', '.golangci.yaml', '.git')(fname) + return util.root_pattern( + '.golangci.yml', + '.golangci.yaml', + '.golangci.toml', + '.golangci.json', + 'go.work', + 'go.mod', + '.git' + )(fname) end, }, docs = { @@ -28,7 +36,7 @@ go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest ]], default_config = { - root_dir = [[root_pattern('go.work') or root_pattern('go.mod', '.golangci.yaml', '.git')]], + root_dir = [[root_pattern('.golangci.yml', '.golangci.yaml', '.golangci.toml', '.golangci.json', 'go.work', 'go.mod', '.git')]], }, }, } |
