diff options
author | w0rp <w0rp@users.noreply.github.com> | 2017-12-17 13:11:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-17 13:11:49 +0000 |
commit | c4956657dc519aaae679b5a04af9b63b0aacabbe (patch) | |
tree | e3e3f3d15ebac3b43c77354753ed64afda319a8f /test | |
parent | fc151d7b301705c97a74d7193f954df4e536f84b (diff) | |
parent | 0d046f5f013b9cf9620ef6f0a593f733051fc708 (diff) | |
download | ale-c4956657dc519aaae679b5a04af9b63b0aacabbe.zip |
Merge pull request #1220 from languitar/linter-alex
Add a linter for alex
Diffstat (limited to 'test')
-rw-r--r-- | test/handler/test_alex_handler.vader | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test/handler/test_alex_handler.vader b/test/handler/test_alex_handler.vader new file mode 100644 index 00000000..eb241f80 --- /dev/null +++ b/test/handler/test_alex_handler.vader @@ -0,0 +1,54 @@ +Execute(The alex handler should handle the example from the alex README): + AssertEqual + \ [ + \ { + \ 'lnum': 1, + \ 'col': 5, + \ 'end_lnum': 1, + \ 'end_col': 13, + \ 'type': 'W', + \ 'text': '`boogeyman` may be insensitive, use `boogey` instead (retext-equality)', + \ }, + \ { + \ 'lnum': 1, + \ 'col': 42, + \ 'end_lnum': 1, + \ 'end_col': 47, + \ 'type': 'W', + \ 'text': '`master` / `slaves` may be insensitive, use `primary` / `replica` instead (retext-equality)', + \ }, + \ { + \ 'lnum': 1, + \ 'col': 69, + \ 'end_lnum': 1, + \ 'end_col': 74, + \ 'type': 'W', + \ 'text': 'Don’t use “slaves”, it’s profane (retext-profanities)', + \ }, + \ { + \ 'lnum': 2, + \ 'col': 52, + \ 'end_lnum': 2, + \ 'end_col': 53, + \ 'type': 'W', + \ 'text': '`he` may be insensitive, use `they`, `it` instead (retext-equality)', + \ }, + \ { + \ 'lnum': 2, + \ 'col': 61, + \ 'end_lnum': 2, + \ 'end_col': 67, + \ 'type': 'W', + \ 'text': '`cripple` may be insensitive, use `person with a limp` instead (retext-equality)', + \ }, + \ ], + \ ale#handlers#alex#Handle(bufnr(''), [ + \ 'example.md', + \ ' 1:5-1:14 warning `boogeyman` may be insensitive, use `boogey` instead boogeyman-boogeywoman retext-equality', + \ ' 1:42-1:48 warning `master` / `slaves` may be insensitive, use `primary` / `replica` instead master-slave retext-equality', + \ ' 1:69-1:75 warning Don’t use “slaves”, it’s profane slaves retext-profanities', + \ ' 2:52-2:54 warning `he` may be insensitive, use `they`, `it` instead he-she retext-equality', + \ ' 2:61-2:68 warning `cripple` may be insensitive, use `person with a limp` instead cripple retext-equality', + \ '', + \ '⚠ 5 warnings', + \ ]) |