]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_dockerlinter_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 'a39f715c13be3352193ffd9c5b7536b8786eff64' as '.vim/bundle/vim-lsp'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_dockerlinter_handler.vader
1 Before:
2   runtime ale_linters/dockerfile/dockerlinter.vim
3
4 After:
5   call ale#linter#Reset()
6
7 Execute(The dockerlinter handler should handle broken JSON):
8   AssertEqual
9   \ [],
10   \ ale_linters#dockerfile#dockerlinter#Handle(bufnr(''), ["{asdf"])
11
12 Execute(The dockerlinter handler should handle an empty string response):
13   AssertEqual
14   \ [],
15   \ ale_linters#dockerfile#dockerlinter#Handle(bufnr(''), [])
16
17 Execute(The dockerlinter handler should handle an empty result, even if it shouldn't happen):
18   AssertEqual
19   \ [],
20   \ ale_linters#dockerfile#dockerlinter#Handle(bufnr(''), ["{}"])
21
22 Execute(The dockerlinter handler should handle a normal example):
23   AssertEqual
24   \ [
25   \   {
26   \     'lnum': 11,
27   \     'type': 'I',
28   \     'code': 'ER0002',
29   \     'text': "Delete the apt-get lists after installing something",
30   \     'detail': "Delete the apt-get lists after installing something\n\nhttps://github.com/buddy-works/dockerfile-linter/blob/master/Rules.md#ER0002",
31   \   },
32   \   {
33   \     'lnum': 11,
34   \     'type': 'I',
35   \     'code': 'ER0010',
36   \     'text': "Avoid additional packages by specifying --no-install-recommends",
37   \     'detail': "Avoid additional packages by specifying --no-install-recommends\n\nhttps://github.com/buddy-works/dockerfile-linter/blob/master/Rules.md#ER0010",
38   \   },
39   \   {
40   \     'lnum': 11,
41   \     'type': 'I',
42   \     'code': 'ER0012',
43   \     'text': "Pin versions in apt get install",
44   \     'detail': "Pin versions in apt get install\n\nhttps://github.com/buddy-works/dockerfile-linter/blob/master/Rules.md#ER0012",
45   \   },
46   \   {
47   \     'lnum': 30,
48   \     'type': 'W',
49   \     'code': 'SC2155',
50   \     'text': "Declare and assign separately to avoid masking return values.",
51   \     'detail': "Declare and assign separately to avoid masking return values.\n\nhttps://www.shellcheck.net/wiki/SC2155",
52   \   },
53   \   {
54   \     'lnum': 30,
55   \     'type': 'W',
56   \     'code': 'SC2046',
57   \     'text': "Quote this to prevent word splitting.",
58   \     'detail': "Quote this to prevent word splitting.\n\nhttps://www.shellcheck.net/wiki/SC2046",
59   \   },
60   \   {
61   \     'lnum': 30,
62   \     'type': 'I',
63   \     'code': 'SC2086',
64   \     'text': "Double quote to prevent globbing and word splitting.",
65   \     'detail': "Double quote to prevent globbing and word splitting.\n\nhttps://www.shellcheck.net/wiki/SC2086",
66   \   },
67   \   {
68   \     'lnum': 31,
69   \     'type': 'W',
70   \     'code': 'SC2046',
71   \     'text': "Quote this to prevent word splitting.",
72   \     'detail': "Quote this to prevent word splitting.\n\nhttps://www.shellcheck.net/wiki/SC2046",
73   \   },
74   \ ],
75   \ ale_linters#dockerfile#dockerlinter#Handle(bufnr(''), [
76   \  '[{"lineNumber":11,"message":"Delete the apt-get lists after installing something","level":"info","code":"ER0002"},{"lineNumber":11,"message":"Avoid additional packages by specifying --no-install-recommends","level":"info","code":"ER0010"},{"lineNumber":11,"message":"Pin versions in apt get install","level":"info","code":"ER0012"},{"lineNumber":30,"message":"Declare and assign separately to avoid masking return values.","level":"warning","code":"SC2155"},{"lineNumber":30,"message":"Quote this to prevent word splitting.","level":"warning","code":"SC2046"},{"lineNumber":30,"message":"Double quote to prevent globbing and word splitting.","level":"info","code":"SC2086"},{"lineNumber":31,"message":"Quote this to prevent word splitting.","level":"warning","code":"SC2046"}]',
77   \ ])