mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
Fix config and executable issues with the textlint linter
This commit is contained in:
@@ -13,23 +13,16 @@ function! ale#handlers#textlint#GetExecutable(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#textlint#GetCommand(buffer) abort
|
||||
let l:cmd_path = ale#path#FindNearestFile(a:buffer, '.textlintrc')
|
||||
let l:executable = ale#handlers#textlint#GetExecutable(a:buffer)
|
||||
let l:config = ale#path#FindNearestFile(a:buffer, '.textlintrc')
|
||||
let l:options = ale#Var(a:buffer, 'textlint_options')
|
||||
|
||||
if !empty(l:cmd_path)
|
||||
return 'textlint'
|
||||
\ . ' -c '
|
||||
\ . l:cmd_path
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' -f json %t'
|
||||
endif
|
||||
|
||||
return 'textlint'
|
||||
return ale#node#Executable(a:buffer, l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . (!empty(l:config) ? ' -c ' . ale#Escape(l:config) : '')
|
||||
\ . ' -f json %t'
|
||||
endfunction
|
||||
|
||||
|
||||
function! ale#handlers#textlint#HandleTextlintOutput(buffer, lines) abort
|
||||
let l:res = get(ale#util#FuzzyJSONDecode(a:lines, []), 0, {'messages': []})
|
||||
let l:output = []
|
||||
|
||||
Reference in New Issue
Block a user