Close #908 - Report phpcs problems as style problems

This commit is contained in:
w0rp 2019-05-14 22:58:58 +01:00
parent 381fe1badf
commit 4234d39d87
No known key found for this signature in database
GPG key ID: 0FC1ECAA8C81CD83
3 changed files with 20 additions and 7 deletions

View file

@ -36,6 +36,7 @@ function! ale_linters#php#phpcs#Handle(buffer, lines) abort
\ 'col': l:match[2] + 0, \ 'col': l:match[2] + 0,
\ 'text': l:text, \ 'text': l:text,
\ 'type': l:type is# 'error' ? 'E' : 'W', \ 'type': l:type is# 'error' ? 'E' : 'W',
\ 'sub_type': 'style',
\}) \})
endfor endfor

View file

@ -0,0 +1,19 @@
Before:
runtime ale_linters/php/phpcs.vim
After:
call ale#linter#Reset()
Execute(phpcs errors should be handled):
AssertEqual
\ [
\ {
\ 'lnum': 18,
\ 'col': 3,
\ 'type': 'E',
\ 'sub_type': 'style',
\ 'text': 'Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)',
\ }],
\ 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)',
\ ])

View file

@ -1,7 +0,0 @@
Execute(errors should include code):
AssertEqual
\ [{'lnum': 18, 'col': 3, 'type': 'E', 'text': 'Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)'}],
\ 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)',
\ ])