Closed itaranto closed 1 year ago
I'm writing a json parser using jq, and I came up with the following configuration:
json
jq
lint.linters.jq = { name = 'jq', cmd = 'jq', stdin = true, stream = 'stderr', ignore_exitcode = true, parser = require('lint.parser').from_pattern( '^(.*): (.+) at line (%d+), column (%d+)$', { 'code', 'message', 'lnum', 'col' }, nil, nil, nil ), }
An example jq error message would be: parse error: Expected another key-value pair at line 27, column 1
parse error: Expected another key-value pair at line 27, column 1
This works fine with the exception that the messages are shifted one line below:
efm-langserver has lint-offset and lint-offset-columns to correct line and column-wise respectively.
efm-langserver
lint-offset
lint-offset-columns
An equivalent configuration for efm-langserver would be:
json-jq: &json-jq lint-command: 'jq' lint-stdin: true lint-offset: 1 lint-formats: - '%m at line %l, column %c'
I wonder if those could be implemented, specially lint-offset.
Does https://github.com/mfussenegger/nvim-lint/pull/356 solve this?
Does #356 solve this?
Yup, { lnum_offset = -1 } did the trick.
{ lnum_offset = -1 }
Thank you!
I'm writing a
json
parser usingjq
, and I came up with the following configuration:An example
jq
error message would be:parse error: Expected another key-value pair at line 27, column 1
This works fine with the exception that the messages are shifted one line below:
efm-langserver
haslint-offset
andlint-offset-columns
to correct line and column-wise respectively.An equivalent configuration for
efm-langserver
would be:I wonder if those could be implemented, specially
lint-offset
.