forked from github-mirrors/ale
fix(ale_linters/phpcs): add support for multiline error messages
This commit is contained in:
parent
08295ce174
commit
e089969404
|
@ -23,7 +23,7 @@ function! ale_linters#php#phpcs#Handle(buffer, lines) abort
|
||||||
" Matches against lines like the following:
|
" Matches against lines like the following:
|
||||||
"
|
"
|
||||||
" /path/to/some-filename.php:18:3: error - Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
|
" /path/to/some-filename.php:18:3: error - Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
|
||||||
let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\) - \(.\+\) (\(.\+\))$'
|
let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\) - \(.\+\) (\(.\+\)).*$'
|
||||||
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)
|
||||||
|
|
|
@ -13,7 +13,16 @@ Execute(phpcs errors should be handled):
|
||||||
\ 'type': 'E',
|
\ 'type': 'E',
|
||||||
\ 'sub_type': 'style',
|
\ 'sub_type': 'style',
|
||||||
\ 'text': 'Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)',
|
\ 'text': 'Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)',
|
||||||
\ }],
|
\ },
|
||||||
|
\ {
|
||||||
|
\ 'lnum': 22,
|
||||||
|
\ 'col': 3,
|
||||||
|
\ 'type': 'E',
|
||||||
|
\ 'sub_type': 'style',
|
||||||
|
\ 'text': 'All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks)',
|
||||||
|
\ },
|
||||||
|
\ ],
|
||||||
\ ale_linters#php#phpcs#Handle(bufnr(''), [
|
\ ale_linters#php#phpcs#Handle(bufnr(''), [
|
||||||
\ '/path/to/some-filename.php:18:3: error - Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)',
|
\ '/path/to/some-filename.php:18:3: error - Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)',
|
||||||
|
\ "/path/to/some-filename.php:22:3: error - All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '\"\n'.",
|
||||||
\ ])
|
\ ])
|
||||||
|
|
Loading…
Reference in New Issue