mfussenegger / nvim-lint

An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
GNU General Public License v3.0
1.76k stars 191 forks source link

trivy: bugfix: line reported as col; bugfix: crash on missing line from trivy; plus refinements #589

Closed bobsrac closed 1 month ago

bobsrac commented 1 month ago

Changes

Bug Descriptions

Output from trivy sometimes includes line info, but not column info. line info is used for both col and lnum in trivy.lua

Output from trivy does not always contain StartLine and EndLine fields. When they are missing, diagnostics are not created for each Misconfiguration from trivy, but instead a single diagnostic is generated with a lua error about accessing a nil value (StartLine).

To reproduce, open the following Dockerfile with trivy enabled as a linter, then look at the reported diagnostics:

FROM ubuntu:24.04
LABEL maintainer="John Doe <john.doe@aol.com>"