Skip to content

Commit

Permalink
golangci-lint: handle relative paths while parsing (#731)
Browse files Browse the repository at this point in the history
Compare absolute paths when determining filename to buffer
matching

Closes #730
  • Loading branch information
plockc authored Jan 21, 2025
1 parent ec9fda1 commit ba3a77b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/lint/linters/golangcilint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ return {
for _, item in ipairs(decoded["Issues"]) do
local curfile = vim.api.nvim_buf_get_name(bufnr)
local lintedfile = cwd .. "/" .. item.Pos.Filename
if curfile == lintedfile then
if vim.fn.fnamemodify(curfile, ":p") == vim.fn.fnamemodify(lintedfile, ":p") then
-- only publish if those are the current file diagnostics
local sv = severities[item.Severity] or severities.warning
table.insert(diagnostics, {
Expand Down

0 comments on commit ba3a77b

Please sign in to comment.