diff options
author | Moritz Röhrich <moritz@ildefons.de> | 2020-11-29 13:50:24 +0100 |
---|---|---|
committer | Moritz Röhrich <moritz@ildefons.de> | 2020-11-29 15:09:47 +0100 |
commit | d9b74caf43ed2bfeb3f090a18fe8b17fe5438c3f (patch) | |
tree | be4669a4010e091d1ed6bd8eec2c2f420233bb8c /test/handler/test_hadolint.vader | |
parent | 03b6978a270107b670b0363d50f3eed4b365ba26 (diff) | |
download | ale-d9b74caf43ed2bfeb3f090a18fe8b17fe5438c3f.zip |
hadolint: Recognize message type
Hadolint is in the process of adding the severity of a lint rule to the
commandline output: https://github.com/hadolint/hadolint/pull/501
This change utilizes that to show the severity in vim.
Diffstat (limited to 'test/handler/test_hadolint.vader')
-rw-r--r-- | test/handler/test_hadolint.vader | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/handler/test_hadolint.vader b/test/handler/test_hadolint.vader new file mode 100644 index 00000000..eec71fbc --- /dev/null +++ b/test/handler/test_hadolint.vader @@ -0,0 +1,49 @@ +Before: + runtime ale_linters/dockerfile/hadolint.vim + +After: + call ale#linter#Reset() + +Execute(The hadolint handler should handle an empty string response): + AssertEqual + \ [], + \ ale_linters#dockerfile#hadolint#Handle(bufnr(''), []) + +Execute(The hadolint handler should handle a normal example): + AssertEqual + \ [ + \ { + \ 'lnum': 1, + \ 'col': 0, + \ 'type': 'W', + \ 'text': "Always tag the version of an image explicitly", + \ 'detail': "DL3006 ( https://github.com/hadolint/hadolint/wiki/DL3006 )\n\nAlways tag the version of an image explicitly", + \ }, +# \ { +# \ 'lnum': 2, +# \ 'col': 0, +# \ 'type': 'E', +# \ 'text': "MAINTAINER is deprecated", +# \ 'detail': "DL4000 ( https://github.com/hadolint/hadolint/wiki/DL4000 )\n\nMAINTAINER is deprecated", +# \ }, +# \ { +# \ 'lnum': 4, +# \ 'col': 0, +# \ 'type': 'W', +# \ 'text': "Specify version with `yum install -y <package>-<version>`.", +# \ 'detail': "DL3033 ( https://github.com/hadolint/hadolint/wiki/DL3033 )\n\nSpecify version with `yum install -y <package>-<version>`.", +# \ }, +# \ { +# \ 'lnum': 12, +# \ 'col': 0, +# \ 'type': 'W', +# \ 'text': "In POSIX sh, brace expansion is undefined.", +# \ 'detail': "SC2039 ( https://github.com/koalaman/shellcheck/wiki/SC2039 )\n\nIn POSIX sh, brace expansion is undefined.", +# \ }, + \ ], + \ ale_linters#dockerfile#hadolint#Handle(bufnr(''), [ + \ '/dev/stdin:1 DL3006 warning: Always tag the version of an image explicitly', +# \ '/dev/stdin:2 DL4000 error: MAINTAINER is deprecated', +# \ '/dev/stdin:4 DL3033 warning: Specify version with `yum install -y <package>-<version>`.', +# \ '/dev/stdin:12 SC2039 warning: In POSIX sh, brace expansion is undefined.' + \ ]) |