From d7a60ade77a30d4eed517030a0c50a5eee059be0 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 19 Nov 2017 12:30:20 +0000 Subject: [PATCH] #852 - Capture error codes for stylelint --- autoload/ale/handlers/css.vim | 3 ++- test/handler/test_stylelint_handler.vader | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/autoload/ale/handlers/css.vim b/autoload/ale/handlers/css.vim index c7ae7c42..de9eadcc 100644 --- a/autoload/ale/handlers/css.vim +++ b/autoload/ale/handlers/css.vim @@ -61,7 +61,8 @@ function! ale#handlers#css#HandleStyleLintFormat(buffer, lines) abort \ 'lnum': l:match[1] + 0, \ 'col': l:match[2] + 0, \ 'type': l:match[3] is# '✖' ? 'E' : 'W', - \ 'text': l:match[4] . ' [' . l:match[5] . ']', + \ 'text': l:match[4], + \ 'code': l:match[5], \}) endfor diff --git a/test/handler/test_stylelint_handler.vader b/test/handler/test_stylelint_handler.vader index 69de1ee4..5cb34601 100644 --- a/test/handler/test_stylelint_handler.vader +++ b/test/handler/test_stylelint_handler.vader @@ -10,13 +10,15 @@ Execute (stylelint errors should be handled correctly): \ 'lnum': 108, \ 'col': 10, \ 'type': 'E', - \ 'text': 'Unexpected leading zero [number-leading-zero]', + \ 'text': 'Unexpected leading zero', + \ 'code': 'number-leading-zero', \ }, \ { \ 'lnum': 116, \ 'col': 20, \ 'type': 'E', - \ 'text': 'Expected a trailing semicolon [declaration-block-trailing-semicolon]', + \ 'text': 'Expected a trailing semicolon', + \ 'code': 'declaration-block-trailing-semicolon', \ }, \ ], \ ale#handlers#css#HandleStyleLintFormat(42, [