diff options
author | Bjorn Neergaard <bjorn@neersighted.com> | 2016-10-20 22:52:25 -0500 |
---|---|---|
committer | Bjorn Neergaard <bjorn@neersighted.com> | 2016-10-20 22:52:25 -0500 |
commit | c697ef05bb3a084588fb6033c2bf915932917afc (patch) | |
tree | 463fb60a82742fae6586f0e5d2ca8bc2bc2eeb2b | |
parent | a2e4af16269cadd5989610cce54c61d14731732b (diff) | |
download | ale-c697ef05bb3a084588fb6033c2bf915932917afc.zip |
Add PEP8 handler test.
-rw-r--r-- | autoload/ale/handlers.vim | 4 | ||||
-rw-r--r-- | test/test_common_handlers.vader | 28 |
2 files changed, 30 insertions, 2 deletions
diff --git a/autoload/ale/handlers.vim b/autoload/ale/handlers.vim index a8d2572f..9ac0c192 100644 --- a/autoload/ale/handlers.vim +++ b/autoload/ale/handlers.vim @@ -99,11 +99,11 @@ function! ale#handlers#HandleCppCheckFormat(buffer, lines) abort \ 'nr': -1, \}) endfor - return l:output + return l:output endfunction -function! ale#handlers#HandlePEP8Format(buffer, lines) +function! ale#handlers#HandlePEP8Format(buffer, lines) abort " Matches patterns line the following: " " Matches patterns line the following: diff --git a/test/test_common_handlers.vader b/test/test_common_handlers.vader index 6fee00b8..ed3b1647 100644 --- a/test/test_common_handlers.vader +++ b/test/test_common_handlers.vader @@ -26,6 +26,34 @@ Then (The loclist should be correct): \ }, \], g:loclist +Execute (Run HandlePEP8Format): + let g:loclist = ale#handlers#HandlePEP8Format(42, [ + \ "stdin:6:6: E111 indentation is not a multiple of four", + \ "test.yml:35: [EANSIBLE0002] Trailing whitespace", + \]) + +Then (The loclist should be correct): + AssertEqual [ + \ { + \ 'bufnr': 42, + \ 'vcol': 0, + \ 'nr': -1, + \ 'lnum': 6, + \ 'col': 6, + \ 'type': 'E', + \ 'text': 'E111: indentation is not a multiple of four', + \ }, + \ { + \ 'bufnr': 42, + \ 'vcol': 0, + \ 'nr': -1, + \ 'lnum': 35, + \ 'col': 0, + \ 'type': 'E', + \ 'text': "EANSIBLE0002: Trailing whitespace", + \ }, + \], g:loclist + Execute (Run HandleGCCFormat): let g:loclist = ale#handlers#HandleGCCFormat(42, [ \ '<stdin>:8:5: warning: conversion lacks type at end of format [-Wformat=]', |