Fixed stylelint not catching all errors.

The original regex failed to account for short lines being padded
to the length of the longest error.
This commit is contained in:
Michał Ziąbkowski 2017-06-06 20:49:57 +02:00
parent 7db805b0cd
commit e4708c356b

View File

@ -42,7 +42,7 @@ function! ale#handlers#css#HandleStyleLintFormat(buffer, lines) abort
" src/main.css " src/main.css
" 108:10 ✖ Unexpected leading zero number-leading-zero " 108:10 ✖ Unexpected leading zero number-leading-zero
" 116:20 ✖ Expected a trailing semicolon declaration-block-trailing-semicolon " 116:20 ✖ Expected a trailing semicolon declaration-block-trailing-semicolon
let l:pattern = '\v^.* (\d+):(\d+) \s+(\S+)\s+ (.*[^ ])\s+([^ ]+)$' let l:pattern = '\v^.* (\d+):(\d+) \s+(\S+)\s+ (.*[^ ])\s+([^ ]+)\s*$'
let l:output = [] let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern) for l:match in ale#util#GetMatches(a:lines, l:pattern)