diff options
author | yasuhiroki <yasuhiroki.duck@gmail.com> | 2018-03-20 08:57:09 +0900 |
---|---|---|
committer | yasuhiroki <yasuhiroki.duck@gmail.com> | 2018-03-24 14:40:44 +0900 |
commit | 1d33d2cacff9816ce487f9000675851041c25901 (patch) | |
tree | 55f23e2d49361584a68cdac050d7f066fa328139 /ale_linters | |
parent | dbf530e87fde81397712a85ed87b6a15131afd4c (diff) | |
download | ale-1d33d2cacff9816ce487f9000675851041c25901.zip |
Support textlint for plaintext without textlintrc
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/markdown/textlint.vim | 20 | ||||
-rw-r--r-- | ale_linters/text/textlint.vim | 9 |
2 files changed, 12 insertions, 17 deletions
diff --git a/ale_linters/markdown/textlint.vim b/ale_linters/markdown/textlint.vim index 4899fb53..26458506 100644 --- a/ale_linters/markdown/textlint.vim +++ b/ale_linters/markdown/textlint.vim @@ -1,23 +1,9 @@ -" Author: tokida https://rouger.info +" Author: tokida https://rouger.info, Yasuhiro Kiyota <yasuhiroki.duck@gmail.com> " 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', +\ 'executable_callback': 'ale#handlers#textlint#GetExecutable', +\ 'command_callback': 'ale#handlers#textlint#GetCommand', \ 'callback': 'ale#handlers#textlint#HandleTextlintOutput', \}) diff --git a/ale_linters/text/textlint.vim b/ale_linters/text/textlint.vim new file mode 100644 index 00000000..8fafdd7d --- /dev/null +++ b/ale_linters/text/textlint.vim @@ -0,0 +1,9 @@ +" Author: Yasuhiro Kiyota <yasuhiroki.duck@gmail.com> +" Description: textlint, a proofreading tool (https://textlint.github.io/) + +call ale#linter#Define('text', { +\ 'name': 'textlint', +\ 'executable_callback': 'ale#handlers#textlint#GetExecutable', +\ 'command_callback': 'ale#handlers#textlint#GetCommand', +\ 'callback': 'ale#handlers#textlint#HandleTextlintOutput', +\}) |