diff options
author | w0rp <w0rp@users.noreply.github.com> | 2017-12-17 13:11:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-17 13:11:49 +0000 |
commit | c4956657dc519aaae679b5a04af9b63b0aacabbe (patch) | |
tree | e3e3f3d15ebac3b43c77354753ed64afda319a8f /autoload | |
parent | fc151d7b301705c97a74d7193f954df4e536f84b (diff) | |
parent | 0d046f5f013b9cf9620ef6f0a593f733051fc708 (diff) | |
download | ale-c4956657dc519aaae679b5a04af9b63b0aacabbe.zip |
Merge pull request #1220 from languitar/linter-alex
Add a linter for alex
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/handlers/alex.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/autoload/ale/handlers/alex.vim b/autoload/ale/handlers/alex.vim new file mode 100644 index 00000000..853d3137 --- /dev/null +++ b/autoload/ale/handlers/alex.vim @@ -0,0 +1,22 @@ +" Author: Johannes Wienke <languitar@semipol.de> +" Description: Error handling for errors in alex output format + +function! ale#handlers#alex#Handle(buffer, lines) abort + " Example output: + " 6:256-6:262 warning Be careful with “killed”, it’s profane in some cases killed retext-profanities + let l:pattern = '^ *\(\d\+\):\(\d\+\)-\(\d\+\):\(\d\+\) \+warning \+\(.\{-\}\) \+\(.\{-\}\) \+\(.\{-\}\)$' + let l:output = [] + + for l:match in ale#util#GetMatches(a:lines, l:pattern) + call add(l:output, { + \ 'lnum': l:match[1] + 0, + \ 'col': l:match[2] + 0, + \ 'end_lnum': l:match[3] + 0, + \ 'end_col': l:match[4] - 1, + \ 'text': l:match[5] . ' (' . (l:match[7]) . ')', + \ 'type': 'W', + \}) + endfor + + return l:output +endfunction |