summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2020-08-17 10:21:36 +0100
committerGitHub <noreply@github.com>2020-08-17 10:21:36 +0100
commit514e5a8baa539f38c62881673727be6f67935d75 (patch)
treecdf3e74a818ed18acf9433687511ddc6642c4218 /ale_linters
parentcfda549056c4b85fba9e2f10ecb502c8a18d6011 (diff)
parent0cea55924ba7780c1f17d17e8509160c77d1ab7c (diff)
downloadale-514e5a8baa539f38c62881673727be6f67935d75.zip
Merge pull request #2940 from davidsierradz/add-markdownlint-options
allow passing custom options to markdownlint
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/markdown/markdownlint.vim13
1 files changed, 12 insertions, 1 deletions
diff --git a/ale_linters/markdown/markdownlint.vim b/ale_linters/markdown/markdownlint.vim
index e935cbfe..7a293938 100644
--- a/ale_linters/markdown/markdownlint.vim
+++ b/ale_linters/markdown/markdownlint.vim
@@ -1,11 +1,22 @@
" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
" Description: Adds support for markdownlint
+call ale#Set('markdown_markdownlint_options', '')
+
+function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort
+ let l:executable = 'markdownlint'
+
+ let l:options = ale#Var(a:buffer, 'markdown_markdownlint_options')
+
+ return ale#Escape(l:executable)
+ \ . (!empty(l:options) ? ' ' . l:options : '') . ' %s'
+endfunction
+
call ale#linter#Define('markdown', {
\ 'name': 'markdownlint',
\ 'executable': 'markdownlint',
\ 'lint_file': 1,
\ 'output_stream': 'both',
-\ 'command': 'markdownlint %s',
+\ 'command': function('ale_linters#markdown#markdownlint#GetCommand'),
\ 'callback': 'ale#handlers#markdownlint#Handle'
\})