branch: elpa/flymake-collection commit 852d47f7b4cac7345d40bd16067842e095aee13b Author: Mohsin Kaleem <mohk...@kisara.moe> Commit: Mohsin Kaleem <mohk...@kisara.moe>
checkers/jq: Fix regression in error output CLOSES #33 --- src/checkers/flymake-collection-jq.el | 2 +- tests/checkers/installers/jq.bash | 1 + tests/checkers/test-cases/jq.yml | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/checkers/flymake-collection-jq.el b/src/checkers/flymake-collection-jq.el index ef3a475056..7ed850c914 100644 --- a/src/checkers/flymake-collection-jq.el +++ b/src/checkers/flymake-collection-jq.el @@ -47,7 +47,7 @@ See URL `https://stedolan.github.io/jq/'." :write-type 'pipe :command (list jq-exec "." "-" null-device) :regexps - ((error bol "parse error: " (message) " at line " line ", column " column eol))) + ((error bol (? "jq: ") "parse error: " (message) " at line " line ", column " column eol))) (provide 'flymake-collection-jq) diff --git a/tests/checkers/installers/jq.bash b/tests/checkers/installers/jq.bash new file mode 100644 index 0000000000..5cc700128b --- /dev/null +++ b/tests/checkers/installers/jq.bash @@ -0,0 +1 @@ +apt-get install -y jq diff --git a/tests/checkers/test-cases/jq.yml b/tests/checkers/test-cases/jq.yml new file mode 100644 index 0000000000..dc0d7816ca --- /dev/null +++ b/tests/checkers/test-cases/jq.yml @@ -0,0 +1,20 @@ +--- +checker: flymake-collection-jq +tests: + - name: no-lints + file: |- + { + "foo": "bar" + } + lints: [] + - name: syntax-error + file: | + { + "a": 1, + "b": "...", + "" + } + lints: + - point: [5, 0] + level: error + message: Objects must consist of key:value pairs (jq)