Merge pull request #3259 from sblask/support-markdownlint-rules-with-multiple-slashes

Support markdownlint rules with multiple slashes
This commit is contained in:
Horacio Sanson 2020-08-01 13:22:22 +09:00 committed by GitHub
commit 316c7c7372
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -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)

View file

@ -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"]'
\ ])