]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_yamllint_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '56df844d3c39ec494dacc69eae34272b27db185a' as '.vim/bundle/asyncomplete'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_yamllint_handler.vader
1 Before:
2   Save g:ale_warn_about_trailing_whitespace
3
4   let g:ale_warn_about_trailing_whitespace = 1
5
6   runtime! ale/handlers/yamllint.vim
7
8 After:
9   Restore
10
11   unlet! b:ale_warn_about_trailing_whitespace
12
13   call ale#linter#Reset()
14
15 Execute(Problems should be parsed correctly for yamllint):
16   AssertEqual
17   \ [
18   \   {
19   \     'lnum': 1,
20   \     'col': 1,
21   \     'type': 'W',
22   \     'text': 'missing document start "---"',
23   \     'code': 'document-start',
24   \   },
25   \   {
26   \     'lnum': 2,
27   \     'col': 1,
28   \     'type': 'E',
29   \     'text': 'syntax error: expected the node content, but found ''<stream end>''',
30   \   },
31   \ ],
32   \ ale#handlers#yamllint#Handle(bufnr(''), [
33   \   'something.yaml:1:1: [warning] missing document start "---" (document-start)',
34   \   'something.yml:2:1: [error] syntax error: expected the node content, but found ''<stream end>''',
35   \ ])
36
37 Execute(The yamllint handler should respect ale_warn_about_trailing_whitespace):
38   AssertEqual
39   \ [
40   \   {
41   \     'lnum': 5,
42   \     'col': 18,
43   \     'type': 'E',
44   \     'text': 'trailing spaces',
45   \     'code': 'trailing-spaces',
46   \   },
47   \ ],
48   \ ale#handlers#yamllint#Handle(bufnr(''), [
49   \   'something.yml:5:18: [error] trailing spaces (trailing-spaces)',
50   \ ])
51
52   let b:ale_warn_about_trailing_whitespace = 0
53
54   AssertEqual
55   \ [
56   \ ],
57   \ ale#handlers#yamllint#Handle(bufnr(''), [
58   \   'something.yml:5:18: [error] trailing spaces (trailing-spaces)',
59   \ ])