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.77k stars 191 forks source link

feat(parser): adds option to not split lines #554

Closed AckslD closed 1 month ago

AckslD commented 3 months ago

I don't know if this is the best solution but I was having issues with the nix linter. The reason seems to be that I get errors such as:

error: undefined variable 'pkg'
       at /home/axel/.config/home-manager/home.nix:23:5:
           22|     # # "Hello, world!" when run.
           23|     pkg.hello
             |     ^
           24|     pkgs.neovim

where the pattern ((%w+): (.+)\n%s*at .+:(%d+):(%d+)) looks for a match which is actually in the above two lines. Since lines from stdout/stderr are passed line by line to the pattern we don't get any match.

This adds an option to from_pattern to not split the lines before passing to the pattern. This can of course then only give a single error at a time. But at least for nix this seems to be the case anyway?

Happy for some suggestions of how to handle this better.