diff options
author | w0rp <devw0rp@gmail.com> | 2018-07-01 13:49:40 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-07-01 13:49:40 +0100 |
commit | 06f61eeeb82f30c0fceea3d1abb231378b445fc3 (patch) | |
tree | c267bb457518de97c82349dfa630e835727b7325 /test/handler | |
parent | e5e14de9aeb23ad8e58a4e69a6b0f2972f9ca3bc (diff) | |
download | ale-06f61eeeb82f30c0fceea3d1abb231378b445fc3.zip |
Respect ale_warn_about_trailing_whitespace for yamllint
Diffstat (limited to 'test/handler')
-rw-r--r-- | test/handler/test_yamllint_handler.vader | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/test/handler/test_yamllint_handler.vader b/test/handler/test_yamllint_handler.vader index 5ba14bc8..1aa0b9f5 100644 --- a/test/handler/test_yamllint_handler.vader +++ b/test/handler/test_yamllint_handler.vader @@ -1,10 +1,18 @@ Before: + Save g:ale_warn_about_trailing_whitespace + + let g:ale_warn_about_trailing_whitespace = 1 + runtime! ale_linters/yaml/yamllint.vim After: + Restore + + unlet! b:ale_warn_about_trailing_whitespace + call ale#linter#Reset() -Execute: +Execute(Problems should be parsed correctly for yamllint): AssertEqual \ [ \ { @@ -25,3 +33,27 @@ Execute: \ 'something.yaml:1:1: [warning] missing document start "---" (document-start)', \ 'something.yml:2:1: [error] syntax error: expected the node content, but found ''<stream end>''', \ ]) + +Execute(The yamllint handler should respect ale_warn_about_trailing_whitespace): + AssertEqual + \ [ + \ { + \ 'lnum': 5, + \ 'col': 18, + \ 'type': 'E', + \ 'text': 'trailing spaces', + \ 'code': 'trailing-spaces', + \ }, + \ ], + \ ale_linters#yaml#yamllint#Handle(bufnr(''), [ + \ 'something.yml:5:18: [error] trailing spaces (trailing-spaces)', + \ ]) + + let b:ale_warn_about_trailing_whitespace = 0 + + AssertEqual + \ [ + \ ], + \ ale_linters#yaml#yamllint#Handle(bufnr(''), [ + \ 'something.yml:5:18: [error] trailing spaces (trailing-spaces)', + \ ]) |