diff options
author | Matthew Armand <marmand68@gmail.com> | 2022-11-04 04:07:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-04 17:07:56 +0900 |
commit | 121fbefeaef165191820aa72858228921bee4416 (patch) | |
tree | 6c9c38cd2a2d759612f0dfb2cac305816724000a /test | |
parent | 483d056528543df3349299db1ecf4aecfd0d7f44 (diff) | |
download | ale-121fbefeaef165191820aa72858228921bee4416.zip |
Add 'dockerfile_hadolint_options' config setting (#4353)
- Add this option so command line arguments can be supplied to hadolint
- This will be respected when running in docker and via the executable
- Preserve the --no-color and - flags, and add these to the list
- Add to docs and tests
Diffstat (limited to 'test')
-rw-r--r-- | test/test_dockerfile_hadolint_linter.vader | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/test/test_dockerfile_hadolint_linter.vader b/test/test_dockerfile_hadolint_linter.vader index 6e02b212..ba7e2187 100644 --- a/test/test_dockerfile_hadolint_linter.vader +++ b/test/test_dockerfile_hadolint_linter.vader @@ -19,6 +19,7 @@ After: Restore silent! unlet b:ale_dockerfile_hadolint_use_docker silent! unlet b:ale_dockerfile_hadolint_docker_image + silent! unlet b:ale_dockerfile_hadolint_options Execute(linter honors ..._use_docker correctly): @@ -55,15 +56,30 @@ Execute(command is correct when using docker): let b:ale_dockerfile_hadolint_use_docker = 'always' AssertEqual - \ "docker run --rm -i hadolint/hadolint hadolint --no-color -", + \ "docker run --rm -i hadolint/hadolint hadolint --no-color -", \ ale_linters#dockerfile#hadolint#GetCommand(bufnr('')) +Execute(command is correct when using docker and supplying options): + let b:ale_dockerfile_hadolint_use_docker = 'always' + let b:ale_dockerfile_hadolint_options = '--ignore DL3006' + + AssertEqual + \ "docker run --rm -i hadolint/hadolint hadolint --ignore DL3006 --no-color -", + \ ale_linters#dockerfile#hadolint#GetCommand(bufnr('')) Execute(command is correct when not docker): let b:ale_dockerfile_hadolint_use_docker = 'never' AssertEqual - \ "hadolint --no-color -", + \ "hadolint --no-color -", + \ ale_linters#dockerfile#hadolint#GetCommand(bufnr('')) + +Execute(command is correct when not docker and supplying options): + let b:ale_dockerfile_hadolint_use_docker = 'never' + let b:ale_dockerfile_hadolint_options = '--ignore DL3006' + + AssertEqual + \ "hadolint --ignore DL3006 --no-color -", \ ale_linters#dockerfile#hadolint#GetCommand(bufnr('')) Execute(test warnings from hadolint): |