amadanmath/diag_ignore.nvim

Diagnostic code string is not always the code part of the diagnostic

Closed this issue · 2 comments

When using different a different setup for a linter (nvim-lint for golangcilint in my case) it is possible that the code of the diagnostic is not always the code part, but comes from the source part

I ended up implementing it a little differently, but I believe this should now work, with

go = { 'prevline', '// nolint: ', code = 'source' },

or, equivalently,

go = {
  'prevline',
  '// nolint: ',
  code = function(diag)
    return diag.source
  end
},

Oh, letting it accept a function is way better!
Also the named options is better, thanks!