Merge branch 'aurieh-master'
This commit is contained in:
commit
1a5ef969a5
@ -110,6 +110,7 @@ formatting.
|
|||||||
| LLVM | [llc](https://llvm.org/docs/CommandGuide/llc.html) |
|
| LLVM | [llc](https://llvm.org/docs/CommandGuide/llc.html) |
|
||||||
| Lua | [luacheck](https://github.com/mpeterv/luacheck) |
|
| Lua | [luacheck](https://github.com/mpeterv/luacheck) |
|
||||||
| Mail | [proselint](http://proselint.com/) |
|
| Mail | [proselint](http://proselint.com/) |
|
||||||
|
| Make | [checkmake](https://github.com/mrtazz/checkmake) |
|
||||||
| Markdown | [mdl](https://github.com/mivok/markdownlint), [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale), [remark-lint](https://github.com/wooorm/remark-lint) !! |
|
| Markdown | [mdl](https://github.com/mivok/markdownlint), [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale), [remark-lint](https://github.com/wooorm/remark-lint) !! |
|
||||||
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
|
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
|
||||||
| Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! |
|
| Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! |
|
||||||
|
24
ale_linters/make/checkmake.vim
Normal file
24
ale_linters/make/checkmake.vim
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
" Author: aurieh - https://github.com/aurieh
|
||||||
|
|
||||||
|
function! ale_linters#make#checkmake#Handle(buffer, lines) abort
|
||||||
|
let l:pattern = '\v^(\d+):(.+):(.+)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
let l:text = l:match[2] . ': ' . l:match[3]
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'bufnr': a:buffer,
|
||||||
|
\ 'lnum': l:match[1] + 0,
|
||||||
|
\ 'type': 'E',
|
||||||
|
\ 'text': l:text,
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('make', {
|
||||||
|
\ 'name': 'checkmake',
|
||||||
|
\ 'executable': 'checkmake',
|
||||||
|
\ 'command': 'checkmake %s --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}"',
|
||||||
|
\ 'callback': 'ale_linters#make#checkmake#Handle',
|
||||||
|
\})
|
@ -267,6 +267,7 @@ Notes:
|
|||||||
* LLVM: `llc`
|
* LLVM: `llc`
|
||||||
* Lua: `luacheck`
|
* Lua: `luacheck`
|
||||||
* Mail: `proselint`
|
* Mail: `proselint`
|
||||||
|
* Make: `checkmake`
|
||||||
* Markdown: `mdl`, `proselint`, `vale`, `remark-lint`
|
* Markdown: `mdl`, `proselint`, `vale`, `remark-lint`
|
||||||
* MATLAB: `mlint`
|
* MATLAB: `mlint`
|
||||||
* Nim: `nim check`!!
|
* Nim: `nim check`!!
|
||||||
|
19
test/handler/test_checkmake_handler.vader
Normal file
19
test/handler/test_checkmake_handler.vader
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Execute(Parsing checkmake errors should work):
|
||||||
|
runtime ale_linters/make/checkmake.vim
|
||||||
|
silent file Makefile
|
||||||
|
|
||||||
|
AssertEqual
|
||||||
|
\ [
|
||||||
|
\ {
|
||||||
|
\ 'bufnr': 42,
|
||||||
|
\ 'lnum': 1,
|
||||||
|
\ 'type': 'E',
|
||||||
|
\ 'text': 'woops: an error has occurred',
|
||||||
|
\ }
|
||||||
|
\ ],
|
||||||
|
\ ale_linters#make#checkmake#Handle(42, [
|
||||||
|
\ 'This shouldnt match',
|
||||||
|
\ '1:woops:an error has occurred',
|
||||||
|
\ ])
|
||||||
|
After:
|
||||||
|
call ale#linter#Reset()
|
Loading…
x
Reference in New Issue
Block a user