From d40f44793194ca383a72426738f5a411682bb241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 11 May 2018 19:15:40 +0200 Subject: Upgrade Elm linter to support 0.19 error reports --- test/elm-test-files/app/node_modules/.bin/elm | 0 test/elm-test-files/app/node_modules/.bin/elm-make | 0 test/handler/test_elmmake_handler.vader | 80 +++++++++++++++------- test/test_elm_executable_detection.vader | 16 ++--- 4 files changed, 62 insertions(+), 34 deletions(-) create mode 100644 test/elm-test-files/app/node_modules/.bin/elm delete mode 100644 test/elm-test-files/app/node_modules/.bin/elm-make (limited to 'test') diff --git a/test/elm-test-files/app/node_modules/.bin/elm b/test/elm-test-files/app/node_modules/.bin/elm new file mode 100644 index 00000000..e69de29b diff --git a/test/elm-test-files/app/node_modules/.bin/elm-make b/test/elm-test-files/app/node_modules/.bin/elm-make deleted file mode 100644 index e69de29b..00000000 diff --git a/test/handler/test_elmmake_handler.vader b/test/handler/test_elmmake_handler.vader index f3424b4b..94bd84ad 100644 --- a/test/handler/test_elmmake_handler.vader +++ b/test/handler/test_elmmake_handler.vader @@ -13,22 +13,13 @@ Execute(The elm-make handler should parse lines correctly): AssertEqual \ [ \ { - \ 'lnum': 33, - \ 'col': 1, - \ 'end_lnum': 33, - \ 'end_col': 19, - \ 'type': 'W', - \ 'text': 'warning overview', - \ 'detail': "warning overview\n\nwarning details", - \ }, - \ { \ 'lnum': 404, \ 'col': 1, \ 'end_lnum': 408, \ 'end_col': 18, \ 'type': 'E', - \ 'text': 'error overview 1', - \ 'detail': "error overview 1\n\nerror details 1", + \ 'text': 'TYPE MISMATCH', + \ 'detail': "error details 1 styled details" \ }, \ { \ 'lnum': 406, @@ -36,8 +27,8 @@ Execute(The elm-make handler should parse lines correctly): \ 'end_lnum': 407, \ 'end_col': 17, \ 'type': 'E', - \ 'text': 'error overview 2', - \ 'detail': "error overview 2\n\nerror details 2", + \ 'text': 'TYPE MISMATCH', + \ 'detail': "error details 2", \ }, \ { \ 'lnum': 406, @@ -45,26 +36,49 @@ Execute(The elm-make handler should parse lines correctly): \ 'end_lnum': 406, \ 'end_col': 93, \ 'type': 'E', - \ 'text': 'error overview 3', - \ 'detail': "error overview 3\n\nerror details 3", + \ 'text': 'TYPE MISMATCH', + \ 'detail': "error details 3", \ }, \ ], \ ale_linters#elm#make#Handle(347, [ - \ '[{"tag":"unused import","overview":"warning overview","details":"warning details","region":{"start":{"line":33,"column":1},"end":{"line":33,"column":19}},"type":"warning","file":"' . b:tmp . 'Module.elm"}]', - \ '[{"tag":"TYPE MISMATCH","overview":"error overview 1","subregion":{"start":{"line":406,"column":5},"end":{"line":408,"column":18}},"details":"error details 1","region":{"start":{"line":404,"column":1},"end":{"line":408,"column":18}},"type":"error","file":"' . b:tmp . 'Module.elm"},{"tag":"TYPE MISMATCH","overview":"error overview 2","subregion":{"start":{"line":407,"column":12},"end":{"line":407,"column":17}},"details":"error details 2","region":{"start":{"line":406,"column":5},"end":{"line":407,"column":17}},"type":"error","file":"' . b:tmp . 'Module.elm"},{"tag":"TYPE MISMATCH","overview":"error overview 3","subregion":{"start":{"line":406,"column":88},"end":{"line":406,"column":93}},"details":"error details 3","region":{"start":{"line":406,"column":5},"end":{"line":406,"column":93}},"type":"error","file":"' . b:tmp . 'Module.elm"}]' + \ '{ + \ "type":"compile-errors", + \ "errors": [ + \ { + \ "path": "' . b:tmp . 'Module.elm", + \ "problems": [ + \ { + \ "title": "TYPE MISMATCH", + \ "message": ["error details 1 ", { "string": "styled details" }], + \ "region": { "start": { "line": 404, "column":1 }, "end": { "line":408, "column":18} } + \ }, + \ { + \ "title": "TYPE MISMATCH", + \ "message": ["error details 2"], + \ "region": { "start": {"line": 406, "column": 5}, "end": {"line": 407, "column": 17} } + \ }, + \ { + \ "title": "TYPE MISMATCH", + \ "message": ["error details 3"], + \ "region": { "start": { "line": 406, "column": 5}, "end": {"line": 406, "column":93 } } + \ } + \ ] + \ } + \ ] + \ }' \ ]) Execute(The elm-make handler should put an error on the first line if a line cannot be parsed): AssertEqual \ [ \ { - \ 'lnum': 33, + \ 'lnum': 404, \ 'col': 1, - \ 'end_lnum': 33, - \ 'end_col': 19, - \ 'type': 'W', - \ 'text': 'warning overview', - \ 'detail': "warning overview\n\nwarning details", + \ 'end_lnum': 408, + \ 'end_col': 18, + \ 'type': 'E', + \ 'text': 'TYPE MISMATCH', + \ 'detail': "error details 1 styled details" \ }, \ { \ 'lnum': 1, @@ -74,7 +88,21 @@ Execute(The elm-make handler should put an error on the first line if a line can \ }, \ ], \ ale_linters#elm#make#Handle(347, [ - \ '[{"tag":"unused import","overview":"warning overview","details":"warning details","region":{"start":{"line":33,"column":1},"end":{"line":33,"column":19}},"type":"warning","file":"' . b:tmp . 'Module.elm"}]', - \ "Not JSON", - \ "Also not JSON", + \ '{ + \ "type":"compile-errors", + \ "errors": [ + \ { + \ "path": "' . b:tmp . 'Module.elm", + \ "problems": [ + \ { + \ "title": "TYPE MISMATCH", + \ "message": ["error details 1 ", { "string": "styled details" }], + \ "region": { "start": { "line": 404, "column":1 }, "end": { "line":408, "column":18} } + \ } + \ ] + \ } + \ ] + \ }', + \ "Not JSON", + \ "Also not JSON", \ ]) diff --git a/test/test_elm_executable_detection.vader b/test/test_elm_executable_detection.vader index 4227cbfa..c17d1bbc 100644 --- a/test/test_elm_executable_detection.vader +++ b/test/test_elm_executable_detection.vader @@ -3,8 +3,8 @@ Before: runtime ale_linters/elm/make.vim After: - unlet! g:ale_elm_make_use_global - unlet! g:ale_elm_make_executable + unlet! g:ale_elm_use_global + unlet! g:ale_elm_executable call ale#test#RestoreDirectory() @@ -12,25 +12,25 @@ Execute(should get valid executable with default params): call ale#test#SetFilename('elm-test-files/app/testfile.elm') AssertEqual - \ ale#path#Simplify(g:dir . '/elm-test-files/app/node_modules/.bin/elm-make'), + \ ale#path#Simplify(g:dir . '/elm-test-files/app/node_modules/.bin/elm'), \ ale_linters#elm#make#GetExecutable(bufnr('')) Execute(should get valid executable with 'use_global' params): - let g:ale_elm_make_use_global = 1 + let g:ale_elm_use_global = 1 call ale#test#SetFilename('elm-test-files/app/testfile.elm') AssertEqual - \ 'elm-make', + \ 'elm', \ ale_linters#elm#make#GetExecutable(bufnr('')) Execute(should get valid executable with 'use_global' and 'executable' params): - let g:ale_elm_make_executable = 'other-elm-make' - let g:ale_elm_make_use_global = 1 + let g:ale_elm_executable = 'other-elm' + let g:ale_elm_use_global = 1 call ale#test#SetFilename('elm-test-files/app/testfile.elm') AssertEqual - \ 'other-elm-make', + \ 'other-elm', \ ale_linters#elm#make#GetExecutable(bufnr('')) -- cgit v1.2.3 From 2f40da76e60c474dd1125e01013051d71fefc48e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 11 May 2018 20:07:28 +0200 Subject: Test global problems and imported module errors --- test/handler/test_elmmake_handler.vader | 71 ++++++++++++++++++++++++++------ test/test_elm_executable_detection.vader | 10 ++--- 2 files changed, 64 insertions(+), 17 deletions(-) (limited to 'test') diff --git a/test/handler/test_elmmake_handler.vader b/test/handler/test_elmmake_handler.vader index 94bd84ad..6d3b23ba 100644 --- a/test/handler/test_elmmake_handler.vader +++ b/test/handler/test_elmmake_handler.vader @@ -9,7 +9,26 @@ After: call ale#linter#Reset() -Execute(The elm-make handler should parse lines correctly): +Execute(The elm make handler should parse general problems correctly): + AssertEqual + \ [ + \ { + \ 'lnum': 1, + \ 'type': 'E', + \ 'text': 'UNKNOWN IMPORT', + \ 'detail': "error details 1\n\nstyled details" + \ } + \ ], + \ ale_linters#elm#make#Handle(347, [ + \ '{ + \ "type": "error", + \ "path": "' . b:tmp . '/Module.elm", + \ "title": "UNKNOWN IMPORT", + \ "message": ["error details 1\n\n", { "string": "styled details" }] + \ }' + \ ]) + +Execute(The elm make handler should parse compilation errors correctly): AssertEqual \ [ \ { @@ -19,7 +38,7 @@ Execute(The elm-make handler should parse lines correctly): \ 'end_col': 18, \ 'type': 'E', \ 'text': 'TYPE MISMATCH', - \ 'detail': "error details 1 styled details" + \ 'detail': "error details 1\n\nstyled details" \ }, \ { \ 'lnum': 406, @@ -42,25 +61,53 @@ Execute(The elm-make handler should parse lines correctly): \ ], \ ale_linters#elm#make#Handle(347, [ \ '{ - \ "type":"compile-errors", + \ "type": "compile-errors", \ "errors": [ \ { - \ "path": "' . b:tmp . 'Module.elm", + \ "path": "' . b:tmp . '/Module.elm", \ "problems": [ \ { \ "title": "TYPE MISMATCH", - \ "message": ["error details 1 ", { "string": "styled details" }], - \ "region": { "start": { "line": 404, "column":1 }, "end": { "line":408, "column":18} } + \ "message": ["error details 1\n\n", { "string": "styled details" }], + \ "region": { "start": { "line": 404, "column": 1 }, "end": { "line": 408, "column": 18 } } \ }, \ { \ "title": "TYPE MISMATCH", \ "message": ["error details 2"], - \ "region": { "start": {"line": 406, "column": 5}, "end": {"line": 407, "column": 17} } + \ "region": { "start": {"line": 406, "column": 5}, "end": {"line": 407, "column": 17 } } \ }, \ { \ "title": "TYPE MISMATCH", \ "message": ["error details 3"], - \ "region": { "start": { "line": 406, "column": 5}, "end": {"line": 406, "column":93 } } + \ "region": { "start": { "line": 406, "column": 5}, "end": {"line": 406, "column": 93 } } + \ } + \ ] + \ } + \ ] + \ }' + \ ]) + +Execute(The elm make handler should put an error on the first line for compilation errors in imported modules): + AssertEqual + \ [ + \ { + \ 'lnum': 1, + \ 'type': 'E', + \ 'text': 'src/Module.elm:404 - TYPE MISMATCH', + \ 'detail': "src/Module.elm:404 -------\n\nerror details\n\nstyled details" + \ }, + \ ], + \ ale_linters#elm#make#Handle(347, [ + \ '{ + \ "type": "compile-errors", + \ "errors": [ + \ { + \ "path": "src/Module.elm", + \ "problems": [ + \ { + \ "title": "TYPE MISMATCH", + \ "message": ["error details\n\n", { "string": "styled details" }], + \ "region": { "start": { "line": 404, "column": 1 }, "end": { "line": 408, "column": 18 } } \ } \ ] \ } @@ -68,7 +115,7 @@ Execute(The elm-make handler should parse lines correctly): \ }' \ ]) -Execute(The elm-make handler should put an error on the first line if a line cannot be parsed): +Execute(The elm make handler should put an error on the first line if a line cannot be parsed): AssertEqual \ [ \ { @@ -89,15 +136,15 @@ Execute(The elm-make handler should put an error on the first line if a line can \ ], \ ale_linters#elm#make#Handle(347, [ \ '{ - \ "type":"compile-errors", + \ "type": "compile-errors", \ "errors": [ \ { - \ "path": "' . b:tmp . 'Module.elm", + \ "path": "' . b:tmp . '/Module.elm", \ "problems": [ \ { \ "title": "TYPE MISMATCH", \ "message": ["error details 1 ", { "string": "styled details" }], - \ "region": { "start": { "line": 404, "column":1 }, "end": { "line":408, "column":18} } + \ "region": { "start": { "line": 404, "column": 1 }, "end": { "line": 408, "column": 18 } } \ } \ ] \ } diff --git a/test/test_elm_executable_detection.vader b/test/test_elm_executable_detection.vader index c17d1bbc..9146eea6 100644 --- a/test/test_elm_executable_detection.vader +++ b/test/test_elm_executable_detection.vader @@ -3,8 +3,8 @@ Before: runtime ale_linters/elm/make.vim After: - unlet! g:ale_elm_use_global - unlet! g:ale_elm_executable + unlet! g:ale_elm_make_use_global + unlet! g:ale_elm_make_executable call ale#test#RestoreDirectory() @@ -16,7 +16,7 @@ Execute(should get valid executable with default params): \ ale_linters#elm#make#GetExecutable(bufnr('')) Execute(should get valid executable with 'use_global' params): - let g:ale_elm_use_global = 1 + let g:ale_elm_make_use_global = 1 call ale#test#SetFilename('elm-test-files/app/testfile.elm') @@ -25,8 +25,8 @@ Execute(should get valid executable with 'use_global' params): \ ale_linters#elm#make#GetExecutable(bufnr('')) Execute(should get valid executable with 'use_global' and 'executable' params): - let g:ale_elm_executable = 'other-elm' - let g:ale_elm_use_global = 1 + let g:ale_elm_make_executable = 'other-elm' + let g:ale_elm_make_use_global = 1 call ale#test#SetFilename('elm-test-files/app/testfile.elm') -- cgit v1.2.3 From c3f61c391bd74e8feb0d7d127ba353093a61b5c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Sat, 12 May 2018 04:16:14 +0200 Subject: Use `message` as `text` instead of `title` `title` does not contain much information which forces to use :ALEDetail most of the time --- test/handler/test_elmmake_handler.vader | 41 +++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'test') diff --git a/test/handler/test_elmmake_handler.vader b/test/handler/test_elmmake_handler.vader index 6d3b23ba..063c0429 100644 --- a/test/handler/test_elmmake_handler.vader +++ b/test/handler/test_elmmake_handler.vader @@ -15,8 +15,7 @@ Execute(The elm make handler should parse general problems correctly): \ { \ 'lnum': 1, \ 'type': 'E', - \ 'text': 'UNKNOWN IMPORT', - \ 'detail': "error details 1\n\nstyled details" + \ 'text': "error details\n\nstyled details" \ } \ ], \ ale_linters#elm#make#Handle(347, [ @@ -24,7 +23,7 @@ Execute(The elm make handler should parse general problems correctly): \ "type": "error", \ "path": "' . b:tmp . '/Module.elm", \ "title": "UNKNOWN IMPORT", - \ "message": ["error details 1\n\n", { "string": "styled details" }] + \ "message": ["error details\n\n", { "string": "styled details" }] \ }' \ ]) @@ -37,8 +36,7 @@ Execute(The elm make handler should parse compilation errors correctly): \ 'end_lnum': 408, \ 'end_col': 18, \ 'type': 'E', - \ 'text': 'TYPE MISMATCH', - \ 'detail': "error details 1\n\nstyled details" + \ 'text': "error details 1\n\nstyled details" \ }, \ { \ 'lnum': 406, @@ -46,8 +44,7 @@ Execute(The elm make handler should parse compilation errors correctly): \ 'end_lnum': 407, \ 'end_col': 17, \ 'type': 'E', - \ 'text': 'TYPE MISMATCH', - \ 'detail': "error details 2", + \ 'text': "error details 2", \ }, \ { \ 'lnum': 406, @@ -55,8 +52,7 @@ Execute(The elm make handler should parse compilation errors correctly): \ 'end_lnum': 406, \ 'end_col': 93, \ 'type': 'E', - \ 'text': 'TYPE MISMATCH', - \ 'detail': "error details 3", + \ 'text': "error details 3", \ }, \ ], \ ale_linters#elm#make#Handle(347, [ @@ -87,18 +83,30 @@ Execute(The elm make handler should parse compilation errors correctly): \ }' \ ]) -Execute(The elm make handler should put an error on the first line for compilation errors in imported modules): +Execute(The elm make handler should handle errors in imported modules): AssertEqual \ [ \ { \ 'lnum': 1, \ 'type': 'E', - \ 'text': 'src/Module.elm:404 - TYPE MISMATCH', - \ 'detail': "src/Module.elm:404 -------\n\nerror details\n\nstyled details" + \ 'text': "src/Module.elm - error details\n\nstyled details", + \ 'detail': "src/Module.elm ----------\n\nerror details\n\nstyled details" + \ }, + \ { + \ 'lnum': 1, + \ 'type': 'E', + \ 'text': "src/Module.elm:404 - error details\n\nstyled details", + \ 'detail': "src/Module.elm:404 ----------\n\nerror details\n\nstyled details" \ }, \ ], \ ale_linters#elm#make#Handle(347, [ \ '{ + \ "type": "error", + \ "path": "src/Module.elm", + \ "title": "UNKNOWN IMPORT", + \ "message": ["error details\n\n", { "string": "styled details" }] + \ }', + \ '{ \ "type": "compile-errors", \ "errors": [ \ { @@ -124,8 +132,7 @@ Execute(The elm make handler should put an error on the first line if a line can \ 'end_lnum': 408, \ 'end_col': 18, \ 'type': 'E', - \ 'text': 'TYPE MISMATCH', - \ 'detail': "error details 1 styled details" + \ 'text': "error details 1\n\nstyled details" \ }, \ { \ 'lnum': 1, @@ -143,13 +150,13 @@ Execute(The elm make handler should put an error on the first line if a line can \ "problems": [ \ { \ "title": "TYPE MISMATCH", - \ "message": ["error details 1 ", { "string": "styled details" }], + \ "message": ["error details 1\n\n", { "string": "styled details" }], \ "region": { "start": { "line": 404, "column": 1 }, "end": { "line": 408, "column": 18 } } \ } \ ] \ } \ ] \ }', - \ "Not JSON", - \ "Also not JSON", + \ 'Not JSON', + \ 'Also not JSON', \ ]) -- cgit v1.2.3 From 115952fae39a70f7b2eee5014da047bc7542816d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Sat, 12 May 2018 20:27:33 +0200 Subject: Show Elm.Kernel as location when `report.path` is `null` in a general problem --- test/handler/test_elmmake_handler.vader | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/handler/test_elmmake_handler.vader b/test/handler/test_elmmake_handler.vader index 063c0429..8abe3295 100644 --- a/test/handler/test_elmmake_handler.vader +++ b/test/handler/test_elmmake_handler.vader @@ -95,6 +95,12 @@ Execute(The elm make handler should handle errors in imported modules): \ { \ 'lnum': 1, \ 'type': 'E', + \ 'text': "Elm.Kernel - error details\n\nstyled details", + \ 'detail': "Elm.Kernel ----------\n\nerror details\n\nstyled details" + \ }, + \ { + \ 'lnum': 1, + \ 'type': 'E', \ 'text': "src/Module.elm:404 - error details\n\nstyled details", \ 'detail': "src/Module.elm:404 ----------\n\nerror details\n\nstyled details" \ }, @@ -107,6 +113,12 @@ Execute(The elm make handler should handle errors in imported modules): \ "message": ["error details\n\n", { "string": "styled details" }] \ }', \ '{ + \ "type": "error", + \ "path": null, + \ "title": "UNKNOWN IMPORT", + \ "message": ["error details\n\n", { "string": "styled details" }] + \ }', + \ '{ \ "type": "compile-errors", \ "errors": [ \ { -- cgit v1.2.3 From b071f1a79587522ea6782c27d7caab8ff88c1bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Tue, 15 May 2018 17:06:52 +0200 Subject: Make Elm linter backwards compatible with Elm 0.18 --- test/handler/test_elmmake_handler.vader | 140 ++++++++++++++++++++++++++++++-- 1 file changed, 134 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/handler/test_elmmake_handler.vader b/test/handler/test_elmmake_handler.vader index 8abe3295..41c9646f 100644 --- a/test/handler/test_elmmake_handler.vader +++ b/test/handler/test_elmmake_handler.vader @@ -9,7 +9,10 @@ After: call ale#linter#Reset() -Execute(The elm make handler should parse general problems correctly): + +" Elm 0.19 + +Execute(The elm-make handler should parse Elm 0.19 general problems correctly): AssertEqual \ [ \ { @@ -27,7 +30,7 @@ Execute(The elm make handler should parse general problems correctly): \ }' \ ]) -Execute(The elm make handler should parse compilation errors correctly): +Execute(The elm-make handler should parse Elm 0.19 compilation errors correctly): AssertEqual \ [ \ { @@ -83,7 +86,7 @@ Execute(The elm make handler should parse compilation errors correctly): \ }' \ ]) -Execute(The elm make handler should handle errors in imported modules): +Execute(The elm-make handler should handle errors in Elm 0.19 imported modules): AssertEqual \ [ \ { @@ -95,8 +98,8 @@ Execute(The elm make handler should handle errors in imported modules): \ { \ 'lnum': 1, \ 'type': 'E', - \ 'text': "Elm.Kernel - error details\n\nstyled details", - \ 'detail': "Elm.Kernel ----------\n\nerror details\n\nstyled details" + \ 'text': "Elm - error details\n\nstyled details", + \ 'detail': "Elm ----------\n\nerror details\n\nstyled details" \ }, \ { \ 'lnum': 1, @@ -135,7 +138,125 @@ Execute(The elm make handler should handle errors in imported modules): \ }' \ ]) -Execute(The elm make handler should put an error on the first line if a line cannot be parsed): + +" Elm 0.18 + +Execute(The elm-make handler should parse Elm 0.18 compilation errors correctly): + AssertEqual + \ [ + \ { + \ 'lnum': 33, + \ 'col': 1, + \ 'end_lnum': 33, + \ 'end_col': 19, + \ 'type': 'W', + \ 'text': 'warning overview', + \ 'detail': "warning overview\n\nwarning details", + \ }, + \ { + \ 'lnum': 404, + \ 'col': 1, + \ 'end_lnum': 408, + \ 'end_col': 18, + \ 'type': 'E', + \ 'text': 'error overview 1', + \ 'detail': "error overview 1\n\nerror details 1", + \ }, + \ { + \ 'lnum': 406, + \ 'col': 5, + \ 'end_lnum': 407, + \ 'end_col': 17, + \ 'type': 'E', + \ 'text': 'error overview 2', + \ 'detail': "error overview 2\n\nerror details 2", + \ }, + \ { + \ 'lnum': 406, + \ 'col': 5, + \ 'end_lnum': 406, + \ 'end_col': 93, + \ 'type': 'E', + \ 'text': 'error overview 3', + \ 'detail': "error overview 3\n\nerror details 3", + \ }, + \ ], + \ ale_linters#elm#make#Handle(347, [ + \ '[ + \ { + \ "tag": "unused import", + \ "overview": "warning overview", + \ "details": "warning details", + \ "region": {"start": { "line": 33, "column": 1 }, "end": { "line": 33, "column": 19 } }, + \ "type": "warning", + \ "file": "' . b:tmp . '/Module.elm" + \ } + \ ]', + \ '[ + \ { + \ "tag": "TYPE MISMATCH", + \ "overview": "error overview 1", + \ "subregion": { "start": { "line": 406, "column": 5 }, "end": { "line": 408, "column": 18 } }, + \ "details": "error details 1", + \ "region": { "start": { "line": 404, "column": 1 }, "end": { "line": 408, "column": 18 } }, + \ "type": "error", + \ "file":"' . b:tmp . '/Module.elm" + \ }, + \ { + \ "tag": "TYPE MISMATCH", + \ "overview": "error overview 2", + \ "subregion": { "start": { "line": 407, "column": 12 }, "end": { "line": 407, "column": 17 } }, + \ "details": "error details 2", + \ "region": { "start": { "line": 406, "column": 5}, "end": { "line": 407, "column": 17 } }, + \ "type":"error", + \ "file":"' . b:tmp . '/Module.elm" + \ }, + \ { + \ "tag": "TYPE MISMATCH", + \ "overview": "error overview 3", + \ "subregion": { "start": { "line": 406, "column": 88 }, "end": { "line": 406, "column": 93 } }, + \ "details": "error details 3", + \ "region": { "start": { "line": 406, "column": 5 }, "end": { "line": 406, "column": 93 } }, + \ "type":"error", + \ "file":"' . b:tmp . '/Module.elm" + \ } + \ ]' + \ ]) + +Execute(The elm-make handler should handle errors in Elm 0.18 imported modules): + AssertEqual + \ [ + \ { + \ 'lnum': 1, + \ 'type': 'E', + \ 'text': "src/Module.elm:33 - error overview", + \ 'detail': "src/Module.elm:33 ----------\n\nerror overview\n\nerror details" + \ } + \ ], + \ ale_linters#elm#make#Handle(347, [ + \ '[ + \ { + \ "tag": "unused import", + \ "overview": "warning overview", + \ "details": "warning details", + \ "region": {"start": { "line": 33, "column": 1 }, "end": { "line": 33, "column": 19 } }, + \ "type": "warning", + \ "file": "src/Module.elm" + \ }, + \ { + \ "tag": "type error", + \ "overview": "error overview", + \ "details": "error details", + \ "region": {"start": { "line": 33, "column": 1 }, "end": { "line": 33, "column": 19 } }, + \ "type": "error", + \ "file": "src/Module.elm" + \ } + \ ]', + \ ]) + +" Generic + +Execute(The elm-make handler should put an error on the first line if a line cannot be parsed): AssertEqual \ [ \ { @@ -172,3 +293,10 @@ Execute(The elm make handler should put an error on the first line if a line can \ 'Not JSON', \ 'Also not JSON', \ ]) + +Execute(The elm-make handler should ignore success lines): + AssertEqual + \ [], + \ ale_linters#elm#make#Handle(347, [ + \ 'Successfully generated /dev/null', + \ ]) -- cgit v1.2.3