summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Lorenzo Rodriguez <jose.zap@gmail.com>2018-01-29 22:21:50 +0100
committerJose Lorenzo Rodriguez <jose.zap@gmail.com>2018-01-29 22:21:50 +0100
commit4df87eaaddfceaddd625294c0e601aebf2f68a85 (patch)
tree3ecbf0220c82c652c84b5a2cd1d5126ad5390003
parentdd413a4732ed52e33ec318c7c15a30cf413c87a3 (diff)
downloadale-4df87eaaddfceaddd625294c0e601aebf2f68a85.zip
Added tests for hadolint
-rw-r--r--README.md2
-rw-r--r--ale_linters/dockerfile/hadolint.vim2
-rw-r--r--doc/ale-dockerfile.txt6
-rw-r--r--test/test_dockerfile_hadolint_linter.vader23
4 files changed, 27 insertions, 6 deletions
diff --git a/README.md b/README.md
index c42f4bfa..bd7a705f 100644
--- a/README.md
+++ b/README.md
@@ -93,7 +93,7 @@ formatting.
| D | [dmd](https://dlang.org/dmd-linux.html) |
| Dafny | [dafny](https://rise4fun.com/Dafny) !! |
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) !!, [language_server](https://github.com/natebosch/dart_language_server) |
-| Dockerfile | [hadolint](https://github.com/lukasmartinelli/hadolint) |
+| Dockerfile | [hadolint](https://github.com/hadolint/hadolint) |
| Elixir | [credo](https://github.com/rrrene/credo), [dialyxir](https://github.com/jeremyjh/dialyxir), [dogma](https://github.com/lpil/dogma) !!|
| Elm | [elm-format](https://github.com/avh4/elm-format), [elm-make](https://github.com/elm-lang/elm-make) |
| Erb | [erb](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis) |
diff --git a/ale_linters/dockerfile/hadolint.vim b/ale_linters/dockerfile/hadolint.vim
index 6e1c7377..7772afbd 100644
--- a/ale_linters/dockerfile/hadolint.vim
+++ b/ale_linters/dockerfile/hadolint.vim
@@ -2,7 +2,7 @@
" always, yes, never
call ale#Set('dockerfile_hadolint_use_docker', 'never')
-call ale#Set('dockerfile_hadolint_docker_image', 'lukasmartinelli/hadolint')
+call ale#Set('dockerfile_hadolint_docker_image', 'hadolint/hadolint')
function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
" Matches patterns line the following:
diff --git a/doc/ale-dockerfile.txt b/doc/ale-dockerfile.txt
index 288addbb..805cc478 100644
--- a/doc/ale-dockerfile.txt
+++ b/doc/ale-dockerfile.txt
@@ -5,7 +5,7 @@ ALE Dockerfile Integration *ale-dockerfile-options*
===============================================================================
hadolint *ale-dockerfile-hadolint*
- hadolint can be found at: https://github.com/lukasmartinelli/hadolint
+ hadolint can be found at: https://github.com/hadolint/hadolint
g:ale_dockerfile_hadolint_use_docker *g:ale_dockerfile_hadolint_use_docker*
@@ -25,12 +25,12 @@ g:ale_dockerfile_hadolint_use_docker *g:ale_dockerfile_hadolint_use_docker*
g:ale_dockerfile_hadolint_image *g:ale_dockerfile_hadolint_image*
*b:ale_dockerfile_hadolint_image*
Type: |String|
- Default: `'lukasmartinelli/hadolint'`
+ Default: `'hadolint/hadolint'`
This variable controls the docker image used to run hadolint. The default
is hadolint's author's build, and can be found at:
- https://hub.docker.com/r/lukasmartinelli/hadolint/
+ https://hub.docker.com/r/hadolint/hadolint/
===============================================================================
diff --git a/test/test_dockerfile_hadolint_linter.vader b/test/test_dockerfile_hadolint_linter.vader
index 7262c5b0..3edbb2b6 100644
--- a/test/test_dockerfile_hadolint_linter.vader
+++ b/test/test_dockerfile_hadolint_linter.vader
@@ -55,7 +55,7 @@ Execute(command is correct when using docker):
let b:ale_dockerfile_hadolint_use_docker = 'always'
AssertEqual
- \ "docker run --rm -i lukasmartinelli/hadolint",
+ \ "docker run --rm -i hadolint/hadolint",
\ ale_linters#dockerfile#hadolint#GetCommand(bufnr(''))
@@ -66,4 +66,25 @@ Execute(command is correct when not docker):
\ "hadolint -",
\ ale_linters#dockerfile#hadolint#GetCommand(bufnr(''))
+Execute(test warnings from hadolint):
+ AssertEqual
+ \ [{'lnum': 10, 'col': 0, 'type': 'W', 'text': 'Using latest is prone to errors', 'detail': "DL3007 ( https://github.com/hadolint/hadolint/wiki/DL3007 )\n\nUsing latest is prone to errors"}],
+ \ ale_linters#dockerfile#hadolint#Handle(bufnr(''), [
+ \ '/dev/stdin:10 DL3007 Using latest is prone to errors',
+ \ ])
+
+Execute(test warnings from shellcheck):
+ AssertEqual
+ \ [{'lnum': 3, 'col': 0, 'type': 'W', 'text': 'bar is referenced but not assigned.', 'detail': "SC2154 ( https://github.com/koalaman/shellcheck/wiki/SC2154 )\n\nbar is referenced but not assigned."}],
+ \ ale_linters#dockerfile#hadolint#Handle(bufnr(''), [
+ \ '/dev/stdin:3 SC2154 bar is referenced but not assigned.',
+ \ ])
+
+Execute(test errors from dockerfile parser):
+ AssertEqual
+ \ [{'lnum': 3, 'col': 4, 'type': 'E', 'text': 'unexpected "A" expecting at least one space after ''RUN''', 'detail': 'unexpected "A" expecting at least one space after ''RUN'''}],
+ \ ale_linters#dockerfile#hadolint#Handle(bufnr(''), [
+ \ "/dev/stdin:3:4 unexpected \"A\" expecting at least one space after 'RUN'",
+ \ ])
+
" fin...