diff options
author | Taylor Blau <me@ttaylorr.com> | 2017-11-07 22:11:49 -0800 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2017-11-07 22:11:49 -0800 |
commit | 248a5eb2f61aafdc7a20d3eea5709476c2a21a5b (patch) | |
tree | 0caff50681c5bbd6dc734a2e8b8ce6f61d64bac6 /ale_linters/dafny | |
parent | 1bf894f48c2169e18e5978c9347e40f186e425ab (diff) | |
download | ale-248a5eb2f61aafdc7a20d3eea5709476c2a21a5b.zip |
ale_linters: add 'dafny' linter
Diffstat (limited to 'ale_linters/dafny')
-rw-r--r-- | ale_linters/dafny/dafny.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ale_linters/dafny/dafny.vim b/ale_linters/dafny/dafny.vim new file mode 100644 index 00000000..8f6c62bc --- /dev/null +++ b/ale_linters/dafny/dafny.vim @@ -0,0 +1,24 @@ +" Author: Taylor Blau <me@ttaylorr.com> + +function! ale_linters#dafny#dafny#Handle(buffer, lines) abort + let l:pattern = '\v(.*)\((\d+),(\d+)\): (.*): (.*)' + let l:output = [] + + for l:match in ale#util#GetMatches(a:lines, l:pattern) + call add(l:output, { + \ 'bufnr': a:buffer, + \ 'col': l:match[3] + 0, + \ 'lnum': l:match[2] + 0, + \ 'text': l:match[5], + \ 'type': l:match[4] =~# '^Error' ? 'E' : 'W' + \ }) + endfor + return l:output +endfunction + +call ale#linter#Define('dafny', { +\ 'name': 'dafny', +\ 'executable': 'dafny', +\ 'command': 'dafny %s /compile:0', +\ 'callback': 'ale_linters#dafny#dafny#Handle', +\ }) |