mirror of
https://github.com/amix/vimrc
synced 2025-08-29 18:35:00 +08:00
Updated plugins
This commit is contained in:
63
sources_non_forked/ale/ale_linters/bicep/bicep.vim
Normal file
63
sources_non_forked/ale/ale_linters/bicep/bicep.vim
Normal file
@ -0,0 +1,63 @@
|
||||
" Author: Carl Smedstad <carl.smedstad at protonmail dot com>
|
||||
" Description: bicep for bicep files
|
||||
|
||||
let g:ale_bicep_bicep_executable =
|
||||
\ get(g:, 'ale_bicep_bicep_executable', 'bicep')
|
||||
|
||||
let g:ale_bicep_bicep_options =
|
||||
\ get(g:, 'ale_bicep_bicep_options', '')
|
||||
|
||||
function! ale_linters#bicep#bicep#Executable(buffer) abort
|
||||
return ale#Var(a:buffer, 'bicep_bicep_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bicep#bicep#Command(buffer) abort
|
||||
let l:executable = ale_linters#bicep#bicep#Executable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'bicep_bicep_options')
|
||||
|
||||
if has('win32')
|
||||
let l:nullfile = 'NUL'
|
||||
else
|
||||
let l:nullfile = '/dev/null'
|
||||
endif
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' build --outfile '
|
||||
\ . l:nullfile
|
||||
\ . ' '
|
||||
\ . l:options
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bicep#bicep#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v^.*\((\d+),(\d+)\)\s:\s([a-zA-Z]*)\s([-a-zA-Z0-9]*):\s(.*)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
if l:match[3] is# 'Error'
|
||||
let l:type = 'E'
|
||||
elseif l:match[3] is# 'Warning'
|
||||
let l:type = 'W'
|
||||
else
|
||||
let l:type = 'I'
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': l:match[2] + 0,
|
||||
\ 'type': l:type,
|
||||
\ 'code': l:match[4],
|
||||
\ 'text': l:match[5],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('bicep', {
|
||||
\ 'name': 'bicep',
|
||||
\ 'executable': function('ale_linters#bicep#bicep#Executable'),
|
||||
\ 'command': function('ale_linters#bicep#bicep#Command'),
|
||||
\ 'callback': 'ale_linters#bicep#bicep#Handle',
|
||||
\ 'output_stream': 'both',
|
||||
\})
|
49
sources_non_forked/ale/ale_linters/yaml/gitlablint.vim
Normal file
49
sources_non_forked/ale/ale_linters/yaml/gitlablint.vim
Normal file
@ -0,0 +1,49 @@
|
||||
call ale#Set('yaml_gitlablint_executable', 'gll')
|
||||
call ale#Set('yaml_gitlablint_options', '')
|
||||
|
||||
function! ale_linters#yaml#gitlablint#GetCommand(buffer) abort
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'yaml_gitlablint_options'))
|
||||
\ . ' -p %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#yaml#gitlablint#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
" (<unknown>): mapping values are not allowed in this context at line 68 column 8
|
||||
" jobs:build:dev config contains unknown keys: ony
|
||||
let l:pattern = '^\(.*\) at line \(\d\+\) column \(\d\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:line in a:lines
|
||||
let l:match = matchlist(l:line, l:pattern)
|
||||
|
||||
if !empty(l:match)
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'text': l:match[1],
|
||||
\ 'type': 'E',
|
||||
\}
|
||||
call add(l:output, l:item)
|
||||
else
|
||||
if l:line isnot# 'GitLab CI configuration is invalid'
|
||||
let l:item = {
|
||||
\ 'lnum': 0,
|
||||
\ 'col': 0,
|
||||
\ 'text': l:line,
|
||||
\ 'type': 'E',
|
||||
\}
|
||||
call add(l:output, l:item)
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('yaml', {
|
||||
\ 'name': 'gitlablint',
|
||||
\ 'executable': {b -> ale#Var(b, 'yaml_gitlablint_executable')},
|
||||
\ 'command': function('ale_linters#yaml#gitlablint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#yaml#gitlablint#Handle',
|
||||
\ 'output_stream': 'stderr',
|
||||
\})
|
19
sources_non_forked/ale/autoload/ale/fixers/syntax_tree.vim
Normal file
19
sources_non_forked/ale/autoload/ale/fixers/syntax_tree.vim
Normal file
@ -0,0 +1,19 @@
|
||||
call ale#Set('ruby_syntax_tree_options', '')
|
||||
call ale#Set('ruby_syntax_tree_executable', 'stree')
|
||||
|
||||
function! ale#fixers#syntax_tree#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_syntax_tree_executable')
|
||||
let l:options = ale#Var(a:buffer, 'ruby_syntax_tree_options')
|
||||
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'stree')
|
||||
\ . ' write'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#syntax_tree#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#fixers#syntax_tree#GetCommand(a:buffer),
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
24
sources_non_forked/ale/doc/ale-bicep.txt
Normal file
24
sources_non_forked/ale/doc/ale-bicep.txt
Normal file
@ -0,0 +1,24 @@
|
||||
===============================================================================
|
||||
ALE Bicep Integration *ale-bicep-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
bicep *ale-bicep-bicep*
|
||||
|
||||
g:ale_bicep_bicep_executable *g:ale_bicep_bicep_executable*
|
||||
*b:ale_bicep_bicep_executable*
|
||||
Type: |String|
|
||||
Default: `'bicep'`
|
||||
|
||||
This variable can be set to change the path to bicep.
|
||||
|
||||
|
||||
g:ale_bicep_bicep_options *g:ale_bicep_bicep_options*
|
||||
*b:ale_bicep_bicep_options*
|
||||
Type: |String|
|
||||
Default: `'build --outfile /dev/null'`
|
||||
|
||||
This variable can be set to pass additional options to bicep.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
Reference in New Issue
Block a user