mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 20:54:26 +08:00
In addition to errors Zeek's parsing can also expose warning messages,
e.g., for the following code
```zeek
event http_stats(c: connection, stats: http_stats_rec) {
c$removal_hooks;
}
```
a warning is emitted
```
warning in /tmp/foo.zeek, line 2: expression value ignored (c$removal_hooks)
```
This patch adds parsing and propagation of these warning messages.
32 lines
768 B
Plaintext
32 lines
768 B
Plaintext
Before:
|
|
runtime ale_linters/zeek/zeek.vim
|
|
|
|
After:
|
|
call ale#linter#Reset()
|
|
|
|
Execute(The zeek handler should parse errors correctly):
|
|
AssertEqual
|
|
\ [
|
|
\ {
|
|
\ 'lnum': 2,
|
|
\ 'text': 'unknown identifier bar, at or near "bar"',
|
|
\ 'type': 'E',
|
|
\ },
|
|
\ ],
|
|
\ ale_linters#zeek#zeek#HandleErrors(bufnr(''), [
|
|
\ 'error in /tmp/foo.zeek, line 2: unknown identifier bar, at or near "bar"'
|
|
\ ])
|
|
|
|
Execute(The zeek handler should parse warnings correctly):
|
|
AssertEqual
|
|
\ [
|
|
\ {
|
|
\ 'lnum': 11,
|
|
\ 'text': 'expression value ignored (c$removal_hooks)',
|
|
\ 'type': 'W',
|
|
\ },
|
|
\ ],
|
|
\ ale_linters#zeek#zeek#HandleErrors(bufnr(''), [
|
|
\ 'warning in /tmp/bar.zeek, line 11: expression value ignored (c$removal_hooks)'
|
|
\ ])
|