mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-17 17:55:56 +08:00
Merge pull request #3259 from sblask/support-markdownlint-rules-with-multiple-slashes
Support markdownlint rules with multiple slashes
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
" Description: Adds support for markdownlint
|
" Description: Adds support for markdownlint
|
||||||
|
|
||||||
function! ale#handlers#markdownlint#Handle(buffer, lines) abort
|
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=[]
|
let l:output=[]
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
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, [
|
\ ale#handlers#markdownlint#Handle(0, [
|
||||||
\ 'README.md:10:20 MD013/line-length Line length [Expected: 80; Actual: 114]'
|
\ '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 New Issue
Block a user