add textlint support for markdown (#1383)

This commit is contained in:
Hideaki Tokida
2018-03-19 02:28:26 +09:00
committed by w0rp
parent c112ee9dff
commit 1b1e53ef61
5 changed files with 85 additions and 2 deletions

View File

@@ -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',
\})