From 9b3d06eb75d10d0895440f8ea45c74fc14dde117 Mon Sep 17 00:00:00 2001 From: ALX99 <46844683+ALX99@users.noreply.github.com> Date: Tue, 25 Apr 2023 08:48:58 +0200 Subject: fix(golangci_lint): root_pattern should look for all supported cfg files (#2574) --- lua/lspconfig/server_configurations/golangci_lint_ls.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lua') 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')]], }, }, } -- cgit v1.2.3-70-g09d2