diff options
-rw-r--r-- | ale_linters/php/phpcs.vim | 1 | ||||
-rw-r--r-- | test/handler/test_phpcs_handler.vader | 19 | ||||
-rw-r--r-- | test/test_phpcs_include_code.vader | 7 |
3 files changed, 20 insertions, 7 deletions
diff --git a/ale_linters/php/phpcs.vim b/ale_linters/php/phpcs.vim index 1c92bbb2..c2c33a1b 100644 --- a/ale_linters/php/phpcs.vim +++ b/ale_linters/php/phpcs.vim @@ -36,6 +36,7 @@ function! ale_linters#php#phpcs#Handle(buffer, lines) abort \ 'col': l:match[2] + 0, \ 'text': l:text, \ 'type': l:type is# 'error' ? 'E' : 'W', + \ 'sub_type': 'style', \}) endfor diff --git a/test/handler/test_phpcs_handler.vader b/test/handler/test_phpcs_handler.vader new file mode 100644 index 00000000..18accece --- /dev/null +++ b/test/handler/test_phpcs_handler.vader @@ -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)', + \ ]) diff --git a/test/test_phpcs_include_code.vader b/test/test_phpcs_include_code.vader deleted file mode 100644 index 1cff1916..00000000 --- a/test/test_phpcs_include_code.vader +++ /dev/null @@ -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)', - \ ]) - |