diff options
author | Horacio Sanson <hsanson@gmail.com> | 2020-08-01 13:22:22 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-01 13:22:22 +0900 |
commit | 316c7c7372ad6f34e439944713655ccff2123f40 (patch) | |
tree | dbe27dfa7303e3c532affd07c71458852743b62a | |
parent | 9894e925539bb65c875fa8c67c9e2ddc4d5a17b1 (diff) | |
parent | fbfeae058712068b50cd4745590af1a5b33f7228 (diff) | |
download | ale-316c7c7372ad6f34e439944713655ccff2123f40.zip |
Merge pull request #3259 from sblask/support-markdownlint-rules-with-multiple-slashes
Support markdownlint rules with multiple slashes
-rw-r--r-- | autoload/ale/handlers/markdownlint.vim | 2 | ||||
-rw-r--r-- | test/handler/test_markdownlint_handler.vader | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/autoload/ale/handlers/markdownlint.vim b/autoload/ale/handlers/markdownlint.vim index 5cef20ee..6c273bd0 100644 --- a/autoload/ale/handlers/markdownlint.vim +++ b/autoload/ale/handlers/markdownlint.vim @@ -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) diff --git a/test/handler/test_markdownlint_handler.vader b/test/handler/test_markdownlint_handler.vader index 8e9f77a0..f2e6e328 100644 --- a/test/handler/test_markdownlint_handler.vader +++ b/test/handler/test_markdownlint_handler.vader @@ -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"]' + \ ]) |