Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Commit

Permalink
Add multiple_files support to golangci_lint builtin (#1550)
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich authored May 10, 2023
1 parent 71797bb commit 08bb00c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lua/null-ls/builtins/diagnostics/golangci_lint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ return h.make_builtin({
to_stdin = true,
from_stderr = false,
ignore_stderr = true,
multiple_files = true,
args = {
"run",
"--fix=false",
Expand All @@ -37,15 +38,14 @@ return h.make_builtin({
local issues = params.output["Issues"]
if type(issues) == "table" then
for _, d in ipairs(issues) do
if d.Pos.Filename == params.bufname then
table.insert(diags, {
source = string.format("golangci-lint:%s", d.FromLinter),
row = d.Pos.Line,
col = d.Pos.Column,
message = d.Text,
severity = h.diagnostics.severities["warning"],
})
end
table.insert(diags, {
source = string.format("golangci-lint:%s", d.FromLinter),
row = d.Pos.Line,
col = d.Pos.Column,
message = d.Text,
severity = h.diagnostics.severities["warning"],
filename = d.Pos.Filename,
})
end
end
return diags
Expand Down

0 comments on commit 08bb00c

Please sign in to comment.