summaryrefslogtreecommitdiff
path: root/ale_linters/dafny
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2017-11-07 22:11:49 -0800
committerTaylor Blau <me@ttaylorr.com>2017-11-07 22:11:49 -0800
commit248a5eb2f61aafdc7a20d3eea5709476c2a21a5b (patch)
tree0caff50681c5bbd6dc734a2e8b8ce6f61d64bac6 /ale_linters/dafny
parent1bf894f48c2169e18e5978c9347e40f186e425ab (diff)
downloadale-248a5eb2f61aafdc7a20d3eea5709476c2a21a5b.zip
ale_linters: add 'dafny' linter
Diffstat (limited to 'ale_linters/dafny')
-rw-r--r--ale_linters/dafny/dafny.vim24
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',
+\ })