Merge pull request #3259 from sblask/support-markdownlint-rules-with-multiple-slashes
Support markdownlint rules with multiple slashes
This commit is contained in:
commit
316c7c7372
2 changed files with 15 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
|||
" Description: Adds support for markdownlint
|
||||
|
||||
function! ale#handlers#markdownlint#Handle(buffer, lines) abort
|
||||
let l:pattern=': \?\(\d\+\)\(:\(\d\+\)\?\)\? \(MD\d\{3}/[A-Za-z0-9-]\+\) \(.*\)$'
|
||||
let l:pattern=': \?\(\d\+\)\(:\(\d\+\)\?\)\? \(MD\d\{3}/[A-Za-z0-9-/]\+\) \(.*\)$'
|
||||
let l:output=[]
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
|
|
|
@ -75,3 +75,17 @@ Execute(The Markdownlint handler should parse post v0.22.0 output with column co
|
|||
\ ale#handlers#markdownlint#Handle(0, [
|
||||
\ 'README.md:10:20 MD013/line-length Line length [Expected: 80; Actual: 114]'
|
||||
\ ])
|
||||
|
||||
Execute(The Markdownlint handler should parse output with multiple slashes in rule name correctly):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 10,
|
||||
\ 'code': 'MD022/blanks-around-headings/blanks-around-headers',
|
||||
\ 'text': 'Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "### something"]',
|
||||
\ 'type': 'W'
|
||||
\ }
|
||||
\ ],
|
||||
\ ale#handlers#markdownlint#Handle(0, [
|
||||
\ 'README.md:10 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "### something"]'
|
||||
\ ])
|
||||
|
|
Reference in a new issue