summaryrefslogtreecommitdiff
path: root/ale_linters/dockerfile
diff options
context:
space:
mode:
authorHoracio Sanson <hsanson@gmail.com>2021-02-02 13:08:18 +0900
committerGitHub <noreply@github.com>2021-02-02 13:08:18 +0900
commit9b5c09047361f3ec2cf18afbb6d1e03047a59778 (patch)
tree13ab27fe9a41dd16c78091ac34ec22728b310990 /ale_linters/dockerfile
parentc747c277c2ead915b56be0f7e25a9f0c8b91b78e (diff)
parentd9b74caf43ed2bfeb3f090a18fe8b17fe5438c3f (diff)
downloadale-9b5c09047361f3ec2cf18afbb6d1e03047a59778.zip
Merge pull request #3472 from m-ildefons/hadolint
hadolint: Recognize message type
Diffstat (limited to 'ale_linters/dockerfile')
-rw-r--r--ale_linters/dockerfile/hadolint.vim18
1 files changed, 14 insertions, 4 deletions
diff --git a/ale_linters/dockerfile/hadolint.vim b/ale_linters/dockerfile/hadolint.vim
index e57cd76d..bed87642 100644
--- a/ale_linters/dockerfile/hadolint.vim
+++ b/ale_linters/dockerfile/hadolint.vim
@@ -9,7 +9,7 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
"
" /dev/stdin:19 DL3001 Pipe chain should start with a raw value.
" /dev/stdin:19:3 unexpected thing
- let l:pattern = '\v^/dev/stdin:(\d+):?(\d+)? ((DL|SC)(\d+) )?(.+)$'
+ let l:pattern = '\v^/dev/stdin:(\d+):?(\d+)? ((DL|SC)(\d+) )?((.+)?: )?(.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
@@ -24,9 +24,19 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
let l:colnum = l:match[2] + 0
endif
- let l:type = 'W'
- let l:text = l:match[6]
- let l:detail = l:match[6]
+ " Shellcheck knows a 'style' severity - pin it to info level as well.
+ if l:match[7] is# 'style'
+ let l:type = 'I'
+ elseif l:match[7] is# 'info'
+ let l:type = 'I'
+ elseif l:match[7] is# 'warning'
+ let l:type = 'W'
+ else
+ let l:type = 'E'
+ endif
+
+ let l:text = l:match[8]
+ let l:detail = l:match[8]
let l:domain = 'https://github.com/hadolint/hadolint/wiki/'
if l:match[4] is# 'SC'