diff options
author | Benjamin Bannier <bbannier@users.noreply.github.com> | 2021-10-24 14:05:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-24 21:05:55 +0900 |
commit | 92f08b5af2f6316312c95c5160c6e02b76370e04 (patch) | |
tree | 163d813a814215fc8fe5830b24f77bd211016dc3 /ale_linters | |
parent | da331acc9e1662e61fb7b829a3f928530fc8e52b (diff) | |
download | ale-92f08b5af2f6316312c95c5160c6e02b76370e04.zip |
Add support for zeek (#3952)
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/zeek/zeek.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ale_linters/zeek/zeek.vim b/ale_linters/zeek/zeek.vim new file mode 100644 index 00000000..e976d75c --- /dev/null +++ b/ale_linters/zeek/zeek.vim @@ -0,0 +1,22 @@ +" Author: Benjamin Bannier <bbannier@gmail.com> +" Description: Support for checking Zeek files. +" +call ale#Set('zeek_zeek_executable', 'zeek') + +function! ale_linters#zeek#zeek#HandleErrors(buffer, lines) abort + let l:pattern = 'error in \v.*, line (\d+): (.*)$' + + return map(ale#util#GetMatches(a:lines, l:pattern), "{ + \ 'lnum': str2nr(v:val[1]), + \ 'text': v:val[2], + \}") +endfunction + +call ale#linter#Define('zeek', { +\ 'name': 'zeek', +\ 'executable': {b -> ale#Var(b, 'zeek_zeek_executable')}, +\ 'output_stream': 'stderr', +\ 'command': {-> '%e --parse-only %s'}, +\ 'callback': 'ale_linters#zeek#zeek#HandleErrors', +\ 'lint_file': 1, +\}) |