Skip to content

Commit

Permalink
fix(golangci_lint): root_pattern should look for all supported cfg fi…
Browse files Browse the repository at this point in the history
…les (#2574)
  • Loading branch information
ALX99 committed Apr 25, 2023
1 parent 94b9b97 commit 9b3d06e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lua/lspconfig/server_configurations/golangci_lint_ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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')]],
},
},
}

0 comments on commit 9b3d06e

Please sign in to comment.