diff options
author | w0rp <devw0rp@gmail.com> | 2018-06-03 10:45:40 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-06-03 10:46:39 +0100 |
commit | 0db12702f33ad139ec3290508b6602ff16d0d444 (patch) | |
tree | 142ebff3538de5fdeb7cc89c80792c98b89c3db4 /test/handler | |
parent | 786fc0a62f2d45b88967aad6d59bb9c483a576ae (diff) | |
download | ale-0db12702f33ad139ec3290508b6602ff16d0d444.zip |
Respect warn_about_trailing_whitespace for gitlint
Diffstat (limited to 'test/handler')
-rw-r--r-- | test/handler/test_gitlint_handler.vader | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/test/handler/test_gitlint_handler.vader b/test/handler/test_gitlint_handler.vader index 73ee988f..60d632a0 100644 --- a/test/handler/test_gitlint_handler.vader +++ b/test/handler/test_gitlint_handler.vader @@ -1,8 +1,16 @@ Before: - runtime ale_linters/gitcommit/gitlint.vim + Save g:ale_warn_about_trailing_whitespace + + let g:ale_warn_about_trailing_whitespace = 1 + + runtime ale_linters/gitcommit/gitlint.vim After: - call ale#linter#Reset() + Restore + + unlet! b:ale_warn_about_trailing_whitespace + + call ale#linter#Reset() Execute(The gitlint handler should handle basic warnings and syntax errors): AssertEqual @@ -39,3 +47,24 @@ Execute(The gitlint handler should handle basic warnings and syntax errors): \ '8: T1 Title exceeds max length (92>72): "some very long commit subject line where the author can''t wait to explain what he just fixed"' \ ]) +Execute(Disabling trailing whitespace warnings should work): + AssertEqual + \ [ + \ { + \ 'lnum': 8, + \ 'type': 'E', + \ 'text': 'Trailing whitespace', + \ 'code': 'T2', + \ }, + \ ], + \ ale_linters#gitcommit#gitlint#Handle(bufnr(''), [ + \ '8: T2 Trailing whitespace', + \]) + + let b:ale_warn_about_trailing_whitespace = 0 + + AssertEqual + \ [], + \ ale_linters#gitcommit#gitlint#Handle(bufnr(''), [ + \ '8: T2 Trailing whitespace', + \ ]) |