diff options
author | w0rp <w0rp@users.noreply.github.com> | 2017-11-08 17:36:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-08 17:36:22 +0000 |
commit | 86e807401795e3dcc9cac63dd3deb1323d048f13 (patch) | |
tree | ea3a1c303303c700f04532e9fed23ecdb6156dad /ale_linters | |
parent | 1bf894f48c2169e18e5978c9347e40f186e425ab (diff) | |
parent | da8012971a5f0e6af63b94bc2fc2e8307c09e1c2 (diff) | |
download | ale-86e807401795e3dcc9cac63dd3deb1323d048f13.zip |
Merge pull request #1093 from ttaylorr/master
ale_linters: add 'dafny' linter
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/dafny/dafny.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ale_linters/dafny/dafny.vim b/ale_linters/dafny/dafny.vim new file mode 100644 index 00000000..8bbf1b13 --- /dev/null +++ b/ale_linters/dafny/dafny.vim @@ -0,0 +1,25 @@ +" 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', +\ 'lint_file': 1, +\ }) |