fix vale option (#5086)

This commit is contained in:
yoan667
2026-01-25 08:30:53 +01:00
committed by GitHub
parent d59cb7b3c2
commit 646d956630
3 changed files with 60 additions and 6 deletions

View File

@@ -1,9 +1,22 @@
" Author: chew-z https://github.com/chew-z
" Description: vale for text files
call ale#Set('vale_executable', 'vale')
call ale#Set('vale_options', '')
function! ale_linters#text#vale#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'vale_executable')
let l:options = ale#Var(a:buffer, 'vale_options')
return ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --output=JSON %t'
endfunction
call ale#linter#Define('text', {
\ 'name': 'vale',
\ 'executable': 'vale',
\ 'command': 'vale --output=JSON %t',
\ 'command': function('ale_linters#text#vale#GetCommand'),
\ 'callback': 'ale#handlers#vale#Handle',
\})