]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_dockerfile_lint_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 'd49e95aa7ba744f0a7f544aca43afdb6aab41f24' as '.vim/bundle/asyncomplete...
[etc/vim.git] / .vim / bundle / ale / test / handler / test_dockerfile_lint_handler.vader
1 Before:
2   runtime ale_linters/dockerfile/dockerfile_lint.vim
3
4 After:
5   call ale#linter#Reset()
6
7 Execute(The dockerfile_lint handler should handle broken JSON):
8   AssertEqual
9   \ [],
10   \ ale_linters#dockerfile#dockerfile_lint#Handle(bufnr(''), ["{asdf"])
11
12 Execute(The dockerfile_lint handler should handle an empty string response):
13   AssertEqual
14   \ [],
15   \ ale_linters#dockerfile#dockerfile_lint#Handle(bufnr(''), [])
16
17 Execute(The dockerfile_lint handler should handle an empty result, even if it shouldn't happen):
18   AssertEqual
19   \ [],
20   \ ale_linters#dockerfile#dockerfile_lint#Handle(bufnr(''), ["{}"])
21
22 Execute(The dockerfile_lint handler should handle a normal example):
23   AssertEqual
24   \ [
25   \   {
26   \     'lnum': -1,
27   \     'type': 'E',
28   \     'text': "Required LABEL name/key 'Name' is not defined",
29   \     'detail': "Required LABEL name/key 'Name' is not defined\n\nhttp://docs.projectatomic.io/container-best-practices/#_recommended_labels_for_your_project",
30   \   },
31   \   {
32   \     'lnum': -1,
33   \     'type': 'E',
34   \     'text': "Required LABEL name/key 'Version' is not defined",
35   \     'detail': "Required LABEL name/key 'Version' is not defined\n\nhttp://docs.projectatomic.io/container-best-practices/#_recommended_labels_for_your_project",
36   \   },
37   \   {
38   \     'lnum': 3,
39   \     'type': 'I',
40   \     'text': "the MAINTAINER command is deprecated",
41   \     'detail': "the MAINTAINER command is deprecated\n\nMAINTAINER is deprecated in favor of using LABEL since Docker v1.13.0\n\nhttps://github.com/docker/cli/blob/master/docs/deprecated.md#maintainer-in-dockerfile",
42   \   },
43   \   {
44   \     'lnum': -1,
45   \     'type': 'I',
46   \     'text': "There is no 'CMD' instruction",
47   \     'detail': "There is no 'CMD' instruction\n\nhttps://docs.docker.com/engine/reference/builder/#cmd",
48   \   },
49   \ ],
50   \ ale_linters#dockerfile#dockerfile_lint#Handle(bufnr(''), [
51   \  '{',
52   \  '  "error": {',
53   \  '    "count": 2,',
54   \  '    "data": [',
55   \  '      {',
56   \  "        \"message\": \"Required LABEL name/key 'Name' is not defined\",",
57   \  '        "line": -1,',
58   \  '        "level": "error",',
59   \  '        "lineContent": "",',
60   \  '        "reference_url": [',
61   \  '          "http://docs.projectatomic.io/container-best-practices/#",',
62   \  '          "_recommended_labels_for_your_project"',
63   \  '        ]',
64   \  '      },',
65   \  '      {',
66   \  "        \"message\": \"Required LABEL name/key 'Version' is not defined\",",
67   \  '        "line": -1,',
68   \  '        "level": "error",',
69   \  '        "lineContent": "",',
70   \  '        "reference_url": [',
71   \  '          "http://docs.projectatomic.io/container-best-practices/#",',
72   \  '          "_recommended_labels_for_your_project"',
73   \  '        ]',
74   \  '      }',
75   \  '    ]',
76   \  '  },',
77   \  '  "warn": {',
78   \  '    "count": 0,',
79   \  '    "data": []',
80   \  '  },',
81   \  '  "info": {',
82   \  '    "count": 2,',
83   \  '    "data": [',
84   \  '      {',
85   \  '        "label": "maintainer_deprecated",',
86   \  '        "regex": {},',
87   \  '        "level": "info",',
88   \  '        "message": "the MAINTAINER command is deprecated",',
89   \  '        "description": "MAINTAINER is deprecated in favor of using LABEL since Docker v1.13.0",',
90   \  '        "reference_url": [',
91   \  '          "https://github.com/docker/cli/blob/master/docs/deprecated.md",',
92   \  '          "#maintainer-in-dockerfile"',
93   \  '        ],',
94   \  '        "lineContent": "MAINTAINER Alexander Olofsson <ace@haxalot.com>",',
95   \  '        "line": 3',
96   \  '      },',
97   \  '      {',
98   \  '        "instruction": "CMD",',
99   \  '        "count": 1,',
100   \  '        "level": "info",',
101   \  "        \"message\": \"There is no 'CMD' instruction\",",
102   \  '        "description": "None",',
103   \  '        "reference_url": [',
104   \  '          "https://docs.docker.com/engine/reference/builder/",',
105   \  '          "#cmd"',
106   \  '        ]',
107   \  '      }',
108   \  '    ]',
109   \  '  },',
110   \  '  "summary": []',
111   \  '}',
112   \ ])