mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-05 09:27:44 +08:00
fix-proselint (#5074)
This commit is contained in:
25
autoload/ale/proselint.vim
Normal file
25
autoload/ale/proselint.vim
Normal file
@@ -0,0 +1,25 @@
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
|
||||
function! ale#proselint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'proselint_executable')
|
||||
endfunction
|
||||
|
||||
function! ale#proselint#GetCommand(buffer, version) abort
|
||||
let l:executable = ale#proselint#GetExecutable(a:buffer)
|
||||
let l:escaped_exec = ale#Escape(l:executable)
|
||||
|
||||
if ale#semver#GTE(a:version, [0, 16, 0])
|
||||
return l:escaped_exec . ' check %t'
|
||||
else
|
||||
return l:escaped_exec . ' %t'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#proselint#GetCommandWithVersionCheck(buffer) abort
|
||||
return ale#semver#RunWithVersionCheck(
|
||||
\ a:buffer,
|
||||
\ ale#proselint#GetExecutable(a:buffer),
|
||||
\ '%e version --output-format json',
|
||||
\ function('ale#proselint#GetCommand')
|
||||
\)
|
||||
endfunction
|
||||
Reference in New Issue
Block a user