Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ansiblelint): Support to the latest output format #70

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions lua/null-ls/builtins/diagnostics/ansiblelint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,20 @@ return h.make_builtin({
params.messages = {}
for _, message in ipairs(params.output) do
if params.temp_path:match(vim.pesc(message.location.path)) then
local row = nil
local col = nil
local row = message.location.lines.begin
if type(row) == "table" then
row = row.line
col = row.column

-- Check if the location has the old or new format
if type(message.location.lines) == "table" then
row = message.location.lines.begin
if type(row) == "table" then
row = row.line
col = row.column
end
elseif type(message.location.positions) == "table" then
local positions = message.location.positions
row = positions.begin.line
col = positions.begin.column
end
table.insert(params.messages, {
row = row,
Expand Down
Loading