mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -1,11 +1,9 @@
|
||||
" Author: Nick Yamane <nick.diego@gmail.com>
|
||||
" Description: gitlint for git commit message files
|
||||
|
||||
let g:ale_gitcommit_gitlint_executable =
|
||||
\ get(g:, 'ale_gitcommit_gitlint_executable', 'gitlint')
|
||||
let g:ale_gitcommit_gitlint_options = get(g:, 'ale_gitcommit_gitlint_options', '')
|
||||
let g:ale_gitcommit_gitlint_use_global = get(g:, 'ale_gitcommit_gitlint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
call ale#Set('gitcommit_gitlint_executable', 'gitlint')
|
||||
call ale#Set('gitcommit_gitlint_options', '')
|
||||
call ale#Set('gitcommit_gitlint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#gitcommit#gitlint#GetExecutable(buffer) abort
|
||||
return ale#python#FindExecutable(a:buffer, 'gitcommit_gitlint', ['gitlint'])
|
||||
@ -13,12 +11,9 @@ endfunction
|
||||
|
||||
function! ale_linters#gitcommit#gitlint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'gitcommit_gitlint_options')
|
||||
let l:executable = ale_linters#gitcommit#gitlint#GetExecutable(a:buffer)
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' lint'
|
||||
endfunction
|
||||
|
||||
return '%e' . ale#Pad(l:options) . ' lint'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
@ -45,7 +40,6 @@ function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
|
||||
call ale#linter#Define('gitcommit', {
|
||||
\ 'name': 'gitlint',
|
||||
\ 'output_stream': 'stderr',
|
||||
@ -53,4 +47,3 @@ call ale#linter#Define('gitcommit', {
|
||||
\ 'command_callback': 'ale_linters#gitcommit#gitlint#GetCommand',
|
||||
\ 'callback': 'ale_linters#gitcommit#gitlint#Handle',
|
||||
\})
|
||||
|
||||
|
Reference in New Issue
Block a user