mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-02 01:23:30 +08:00
Merge remote-tracking branch 'origin/master' into fix-swipl
* origin/master: (40 commits) fix: correct suggested filetype for yamlfix feat: add yamlfix fixer Use _config for LSP config options Add support for R languageserver (#3370) Fix 3103 - add shellcheck shell directive detection. (#3216) Added the Vundle command in installation instructions (#3400) Adds support for Tlint - A Tighten Opinionated PHP Linter (#3291) Add php phpcbf options (#3383) Use has('gui_running') instead of has('gui') Close #2727 - Add a hover-only setting for balloons Fix #3332 - Modify everything for rename/actions Add a missing blank line in documentation Add luafmt fixer (#3289) #3442 Fix code fix clangd issue Close #1466 - Add GVIM refactor menu support Look for node packages in .yarn/sdks as well Update documentation for code actions and rename cmp forwards, and reverse the code actions Support for LSP/tsserver Code Actions (#3437) Move the test for buffer-local variables ...
This commit is contained in:
37
test/handler/test_erlang_elvis_handler.vader
Normal file
37
test/handler/test_erlang_elvis_handler.vader
Normal file
@@ -0,0 +1,37 @@
|
||||
Before:
|
||||
runtime ale_linters/erlang/elvis.vim
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(Warning messages should be handled):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 11,
|
||||
\ 'text': "Replace the 'if' expression on line 11 with a 'case' expression or function clauses.",
|
||||
\ 'type': 'W',
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 20,
|
||||
\ 'text': 'Remove the debug call to io:format/1 on line 20.',
|
||||
\ 'type': 'W',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#erlang#elvis#Handle(bufnr(''), [
|
||||
\ "src/foo.erl:11:no_if_expression:Replace the 'if' expression on line 11 with a 'case' expression or function clauses.",
|
||||
\ 'src/foo.erl:20:no_debug_call:Remove the debug call to io:format/1 on line 20.',
|
||||
\ ])
|
||||
|
||||
Execute(Line length message shouldn't contain the line itself):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 24,
|
||||
\ 'text': 'Line 24 is too long.',
|
||||
\ 'type': 'W',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#erlang#elvis#Handle(bufnr(''), [
|
||||
\ 'src/foo.erl:24:line_length:Line 24 is too long: io:format("Look ma, too long!"),.',
|
||||
\ ])
|
||||
@@ -13,7 +13,16 @@ Execute(phpcs errors should be handled):
|
||||
\ 'type': 'E',
|
||||
\ 'sub_type': 'style',
|
||||
\ '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(''), [
|
||||
\ '/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'.",
|
||||
\ ])
|
||||
|
||||
34
test/handler/test_tlint_handler.vader
Normal file
34
test/handler/test_tlint_handler.vader
Normal file
@@ -0,0 +1,34 @@
|
||||
Before:
|
||||
runtime ale_linters/php/tlint.vim
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The tlint handler should calculate line numbers):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': '5',
|
||||
\ 'col': 0,
|
||||
\ 'sub_type':
|
||||
\ 'style',
|
||||
\ 'type': 'W',
|
||||
\ 'text': ['! There should be no unused imports.', 'There should be no unused imports.', '', '', '', '', '', '', '', '']
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': '15',
|
||||
\ 'col': 0,
|
||||
\ 'sub_type':
|
||||
\ 'style',
|
||||
\ 'type': 'W',
|
||||
\ 'text': ['! There should be no method visibility in test methods.', 'There should be no method visibility in test methods.', '', '', '', '', '', '', '', '']
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#php#tlint#Handle(347, [
|
||||
\ "Lints for /Users/jose/Code/Tighten/tester/tests/Unit/ExampleTest.php",
|
||||
\ "============",
|
||||
\ "! There should be no unused imports.",
|
||||
\ "5 : `use Illuminate\Foundation\Testing\RefreshDatabase;`",
|
||||
\ "! There should be no method visibility in test methods.",
|
||||
\ "15 : ` public function testBasicTest()`",
|
||||
\ ])
|
||||
Reference in New Issue
Block a user