mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-09 22:14:44 +08:00
Add textlint for Asciidoc and add it to Fixers (#2193)
* Add textlint for asciidoc * Add textlint --fix
This commit is contained in:
@@ -170,6 +170,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['rust'],
|
||||
\ 'description': 'Fix Rust files with Rustfmt.',
|
||||
\ },
|
||||
\ 'textlint': {
|
||||
\ 'function': 'ale#fixers#textlint#Fix',
|
||||
\ 'suggested_filetypes': ['text','markdown','asciidoc'],
|
||||
\ 'description': 'Fix text files with textlint --fix',
|
||||
\ },
|
||||
\ 'hackfmt': {
|
||||
\ 'function': 'ale#fixers#hackfmt#Fix',
|
||||
\ 'suggested_filetypes': ['hack'],
|
||||
|
||||
15
autoload/ale/fixers/textlint.vim
Normal file
15
autoload/ale/fixers/textlint.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Author: TANIGUCHI Masaya <ta2gch@gmail.com>
|
||||
" Description: Integration of textlint with ALE.
|
||||
|
||||
function! ale#fixers#textlint#Fix(buffer) abort
|
||||
let l:executable = ale#handlers#textlint#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'textlint_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' --fix'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user