From 1b1e53ef6101e98ff34044a127758513dbf662e4 Mon Sep 17 00:00:00 2001 From: Hideaki Tokida Date: Mon, 19 Mar 2018 02:28:26 +0900 Subject: add textlint support for markdown (#1383) --- ale_linters/markdown/textlint.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ale_linters/markdown/textlint.vim (limited to 'ale_linters') diff --git a/ale_linters/markdown/textlint.vim b/ale_linters/markdown/textlint.vim new file mode 100644 index 00000000..4899fb53 --- /dev/null +++ b/ale_linters/markdown/textlint.vim @@ -0,0 +1,23 @@ +" Author: tokida https://rouger.info +" Description: textlint, a proofreading tool (https://textlint.github.io/) + +function! ale_linters#markdown#textlint#GetCommand(buffer) abort + let l:cmd_path = ale#path#FindNearestFile(a:buffer, '.textlintrc') + + if !empty(l:cmd_path) + return 'textlint' + \ . ' -c ' + \ . l:cmd_path + \ . ' -f json %t' + endif + + return '' +endfunction + + +call ale#linter#Define('markdown', { +\ 'name': 'textlint', +\ 'executable': 'textlint', +\ 'command_callback': 'ale_linters#markdown#textlint#GetCommand', +\ 'callback': 'ale#handlers#textlint#HandleTextlintOutput', +\}) -- cgit v1.2.3