Report exceptions thrown for stylelint

This commit is contained in:
w0rp
2017-07-03 16:13:01 +01:00
parent 5a3cfbbdf5
commit fd6f05c9ea
2 changed files with 30 additions and 0 deletions

View File

@@ -37,6 +37,18 @@ function! ale#handlers#css#HandleCSSLintFormat(buffer, lines) abort
endfunction
function! ale#handlers#css#HandleStyleLintFormat(buffer, lines) abort
let l:exception_pattern = '\v^Error:'
for l:line in a:lines[:10]
if len(matchlist(l:line, l:exception_pattern)) > 0
return [{
\ 'lnum': 1,
\ 'text': 'stylelint exception thrown (type :ALEDetail for more information)',
\ 'detail': join(a:lines, "\n"),
\}]
endif
endfor
" Matches patterns line the following:
"
" src/main.css