mirror of
https://github.com/dense-analysis/ale
synced 2024-12-27 16:42:19 +00:00
Merge remote-tracking branch 'tylucaskelley/master'
This commit is contained in:
commit
64c95d4881
@ -121,7 +121,7 @@ formatting.
|
||||
| Lua | [luac](https://www.lua.org/manual/5.1/luac.html), [luacheck](https://github.com/mpeterv/luacheck) |
|
||||
| Mail | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
||||
| Make | [checkmake](https://github.com/mrtazz/checkmake) |
|
||||
| Markdown | [alex](https://github.com/wooorm/alex) !!, [mdl](https://github.com/mivok/markdownlint), [prettier](https://github.com/prettier/prettier), [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [remark-lint](https://github.com/wooorm/remark-lint) !!, [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) , [textlint](https://textlint.github.io/)|
|
||||
| Markdown | [alex](https://github.com/wooorm/alex) !!, [markdownlint](https://github.com/DavidAnson/markdownlint) !!, [mdl](https://github.com/mivok/markdownlint), [prettier](https://github.com/prettier/prettier), [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [remark-lint](https://github.com/wooorm/remark-lint) !!, [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) , [textlint](https://textlint.github.io/)|
|
||||
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
|
||||
| Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! |
|
||||
| nix | [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate) |
|
||||
|
11
ale_linters/markdown/markdownlint.vim
Normal file
11
ale_linters/markdown/markdownlint.vim
Normal file
@ -0,0 +1,11 @@
|
||||
" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
|
||||
" Description: Adds support for markdownlint
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'markdownlint',
|
||||
\ 'executable': 'markdownlint',
|
||||
\ 'lint_file': 1,
|
||||
\ 'output_stream': 'both',
|
||||
\ 'command': 'markdownlint %s',
|
||||
\ 'callback': 'ale#handlers#markdownlint#Handle'
|
||||
\ })
|
17
autoload/ale/handlers/markdownlint.vim
Normal file
17
autoload/ale/handlers/markdownlint.vim
Normal file
@ -0,0 +1,17 @@
|
||||
" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
|
||||
" Description: Adds support for markdownlint
|
||||
|
||||
function! ale#handlers#markdownlint#Handle(buffer, lines) abort
|
||||
let l:pattern=': \(\d*\): \(MD\d\{3}\)\(\/\)\([A-Za-z0-9-]\+\)\(.*\)$'
|
||||
let l:output=[]
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'text': '(' . l:match[2] . l:match[3] . l:match[4] . ')' . l:match[5],
|
||||
\ 'type': 'W',
|
||||
\ })
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
@ -346,7 +346,7 @@ Notes:
|
||||
* Lua: `luac`, `luacheck`
|
||||
* Mail: `alex`!!, `proselint`, `vale`
|
||||
* Make: `checkmake`
|
||||
* Markdown: `alex`!!, `mdl`, `prettier`, `proselint`, `redpen`, `remark-lint`, `vale`, `write-good`, `textlint`
|
||||
* Markdown: `alex`!!, `markdownlint`!!, `mdl`, `prettier`, `proselint`, `redpen`, `remark-lint`, `vale`, `write-good`, `textlint`
|
||||
* MATLAB: `mlint`
|
||||
* Nim: `nim check`!!
|
||||
* nix: `nix-instantiate`
|
||||
|
24
test/handler/test_markdownlint_handler.vader
Normal file
24
test/handler/test_markdownlint_handler.vader
Normal file
@ -0,0 +1,24 @@
|
||||
Before:
|
||||
runtime ale_linters/markdown/markdownlint.vim
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The Markdownlint handler should parse output correctly):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 1,
|
||||
\ 'text': '(MD002/first-header-h1) First header should be a top level header [Expected: h1; Actual: h2]',
|
||||
\ 'type': 'W'
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 298,
|
||||
\ 'text': '(MD033/no-inline-html) Inline HTML [Element: p]',
|
||||
\ 'type': 'W'
|
||||
\ }
|
||||
\ ],
|
||||
\ ale#handlers#markdownlint#Handle(0, [
|
||||
\ 'README.md: 1: MD002/first-header-h1 First header should be a top level header [Expected: h1; Actual: h2]',
|
||||
\ 'README.md: 298: MD033/no-inline-html Inline HTML [Element: p]'
|
||||
\ ])
|
Loading…
Reference in New Issue
Block a user