diff options
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/markdown/textlint.vim | 23 |
1 files changed, 23 insertions, 0 deletions
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', +\}) |