]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_hadolint.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_hadolint.vader
1 Before:
2   runtime ale_linters/dockerfile/hadolint.vim
3
4 After:
5   call ale#linter#Reset()
6
7 Execute(The hadolint handler should handle an empty string response):
8   AssertEqual
9   \ [],
10   \ ale_linters#dockerfile#hadolint#Handle(bufnr(''), [])
11
12 Execute(The hadolint handler should handle a normal example):
13   AssertEqual
14   \ [
15   \   {
16   \     'lnum': 1,
17   \     'col': 0,
18   \     'type': 'W',
19   \     'code': 'DL3006',
20   \     'text': 'Always tag the version of an image explicitly',
21   \     'detail': "DL3006 ( https://github.com/hadolint/hadolint/wiki/DL3006 )\n\nAlways tag the version of an image explicitly",
22   \   },
23   \   {
24   \     'lnum': 4,
25   \     'col': 0,
26   \     'type': 'W',
27   \     'code': 'DL3033',
28   \     'text': 'Specify version with `yum install -y <package>-<version>`.',
29   \     'detail': "DL3033 ( https://github.com/hadolint/hadolint/wiki/DL3033 )\n\nSpecify version with `yum install -y <package>-<version>`.",
30   \   },
31   \   {
32   \     'lnum': 12,
33   \     'col': 0,
34   \     'type': 'W',
35   \     'code': 'SC2039',
36   \     'text': 'In POSIX sh, brace expansion is undefined.',
37   \     'detail': "SC2039 ( https://github.com/koalaman/shellcheck/wiki/SC2039 )\n\nIn POSIX sh, brace expansion is undefined.",
38   \   },
39   \ ],
40   \ ale_linters#dockerfile#hadolint#Handle(bufnr(''), [
41   \ '-:1 DL3006 warning: Always tag the version of an image explicitly',
42   \ '-:4 DL3033 warning: Specify version with `yum install -y <package>-<version>`.',
43   \ '-:12 SC2039 warning: In POSIX sh, brace expansion is undefined.',
44   \ ])
45
46 Execute(The hadolint handler should handle parsing errors):
47   AssertEqual
48   \ [
49   \   {
50   \     'lnum': 1,
51   \     'col': 1,
52   \     'type': 'E',
53   \     'text': "unexpected 'b' expecting '#', ADD, ARG, CMD, COPY, ENTRYPOINT, ENV, EXPOSE, FROM, HEALTHCHECK, LABEL, MAINTAINER, ONBUILD, RUN, SHELL, STOPSIGNAL, USER, VOLUME, WORKDIR, or end of input",
54   \     'detail': "hadolint could not parse the file because of a syntax error.",
55   \   },
56   \ ],
57   \ ale_linters#dockerfile#hadolint#Handle(bufnr(''), [
58   \ '/dev/stdin:1:1 unexpected ''b'' expecting ''#'', ADD, ARG, CMD, COPY, ENTRYPOINT, ENV, EXPOSE, FROM, HEALTHCHECK, LABEL, MAINTAINER, ONBUILD, RUN, SHELL, STOPSIGNAL, USER, VOLUME, WORKDIR, or end of input',
59   \ ])