From e969d97843ca6a8f2beddf05f45d2733c0589a52 Mon Sep 17 00:00:00 2001 From: Naoya Inada Date: Mon, 13 Mar 2017 20:09:49 +0900 Subject: [PATCH] Fix pattern of output for coffeelint --- ale_linters/coffee/coffeelint.vim | 2 +- test/handler/test_coffeelint_handler.vader | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test/handler/test_coffeelint_handler.vader diff --git a/ale_linters/coffee/coffeelint.vim b/ale_linters/coffee/coffeelint.vim index a7960b98..e32f7b79 100644 --- a/ale_linters/coffee/coffeelint.vim +++ b/ale_linters/coffee/coffeelint.vim @@ -21,7 +21,7 @@ function! ale_linters#coffee#coffeelint#Handle(buffer, lines) abort " stdin,14,,error,Throwing strings is forbidden " " Note that we currently ignore lineNumberEnd for multiline errors - let l:pattern = 'stdin,\(\d\+\),\(\d*\),\(.\+\),\(.\+\)' + let l:pattern = 'stdin,\(\d\+\),\(\d*\),\(.\{-1,}\),\(.\+\)' let l:output = [] for l:line in a:lines diff --git a/test/handler/test_coffeelint_handler.vader b/test/handler/test_coffeelint_handler.vader new file mode 100644 index 00000000..2d56e7c8 --- /dev/null +++ b/test/handler/test_coffeelint_handler.vader @@ -0,0 +1,20 @@ +Execute(The coffeelint handler should parse lines correctly): + runtime ale_linters/coffee/coffeelint.vim + + AssertEqual + \ [ + \ { + \ 'bufnr': 347, + \ 'lnum': 125, + \ 'col': 1, + \ 'text': "Line exceeds maximum allowed length Length is 122, max is 120.", + \ 'type': 'E', + \ }, + \ ], + \ ale_linters#coffee#coffeelint#Handle(347, [ + \ "path,lineNumber,lineNumberEnd,level,message", + \ "stdin,125,,error,Line exceeds maximum allowed length Length is 122, max is 120.", + \ ]) + +After: + call ale#linter#Reset()