diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-15 17:35:34 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-15 17:35:34 +0000 |
commit | cf538c3a58d61cfe1a77d79455efb9175479fba3 (patch) | |
tree | 10d39afa2ce21641ab689cfd35fd84218f66cf2a /test | |
parent | 08f4f8f0fc2a6698dd48da7871209070ddfdb754 (diff) | |
download | ale-cf538c3a58d61cfe1a77d79455efb9175479fba3.zip |
#852 Capture error codes for pylint, throw away the msgid values
Diffstat (limited to 'test')
-rw-r--r-- | test/handler/test_pylint_handler.vader | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/test/handler/test_pylint_handler.vader b/test/handler/test_pylint_handler.vader index 2314e9b2..aff40845 100644 --- a/test/handler/test_pylint_handler.vader +++ b/test/handler/test_pylint_handler.vader @@ -1,47 +1,60 @@ Before: + Save g:ale_warn_about_trailing_whitespace + + let g:ale_warn_about_trailing_whitespace = 1 + runtime ale_linters/python/pylint.vim After: + Restore + call ale#linter#Reset() + silent file something_else.py -Execute(pylint handler parsing, translating columns to 1-based index): +Execute(Basic pylint errors should be handle): AssertEqual \ [ \ { \ 'lnum': 4, \ 'col': 1, - \ 'text': 'C0303: Trailing whitespace (trailing-whitespace)', + \ 'text': 'Trailing whitespace', + \ 'code': 'trailing-whitespace', \ 'type': 'W', \ }, \ { \ 'lnum': 1, \ 'col': 1, - \ 'text': 'C0111: Missing module docstring (missing-docstring)', + \ 'text': 'Missing module docstring', + \ 'code': 'missing-docstring', \ 'type': 'W', \ }, \ { \ 'lnum': 2, \ 'col': 1, - \ 'text': 'C0111: Missing function docstring (missing-docstring)', + \ 'text': 'Missing function docstring', + \ 'code': 'missing-docstring', \ 'type': 'W', \ }, \ { \ 'lnum': 3, \ 'col': 5, - \ 'text': 'E0103: ''break'' not properly in loop (not-in-loop)', + \ 'text': '''break'' not properly in loop', + \ 'code': 'not-in-loop', \ 'type': 'E', \ }, \ { \ 'lnum': 4, \ 'col': 5, - \ 'text': 'W0101: Unreachable code (unreachable)', + \ 'text': 'Unreachable code', + \ 'code': 'unreachable', \ 'type': 'W', \ }, \ { \ 'lnum': 7, \ 'col': 33, - \ 'text': 'W0702: No exception type(s) specified (bare-except)', + \ 'text': 'No exception type(s) specified', + \ 'code': 'bare-except', \ 'type': 'W', \ }, \ ], @@ -58,3 +71,26 @@ Execute(pylint handler parsing, translating columns to 1-based index): \ '------------------------------------------------------------------', \ 'Your code has been rated at 0.00/10 (previous run: 2.50/10, -2.50)', \ ]) + +Execute(Ignoring trailing whitespace messages should work): + let g:ale_warn_about_trailing_whitespace = 0 + + AssertEqual + \ [ + \ { + \ 'lnum': 1, + \ 'col': 1, + \ 'text': 'Missing module docstring', + \ 'code': 'missing-docstring', + \ 'type': 'W', + \ }, + \ ], + \ ale_linters#python#pylint#Handle(bufnr(''), [ + \ 'No config file found, using default configuration', + \ '************* Module test', + \ 'test.py:4:0: C0303 (trailing-whitespace) Trailing whitespace', + \ 'test.py:1:0: C0111 (missing-docstring) Missing module docstring', + \ '', + \ '------------------------------------------------------------------', + \ 'Your code has been rated at 0.00/10 (previous run: 2.50/10, -2.50)', + \ ]) |