From 248a5eb2f61aafdc7a20d3eea5709476c2a21a5b Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Tue, 7 Nov 2017 22:11:49 -0800 Subject: ale_linters: add 'dafny' linter --- ale_linters/dafny/dafny.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ale_linters/dafny/dafny.vim (limited to 'ale_linters/dafny/dafny.vim') 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 + +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', +\ }) -- cgit v1.2.3