mirror of
https://github.com/amix/vimrc
synced 2025-07-12 06:05:01 +08:00
Update plugins from upstream.
This commit is contained in:
37
sources_non_forked/ale/ale_linters/cairo/starknet.vim
Normal file
37
sources_non_forked/ale/ale_linters/cairo/starknet.vim
Normal file
@ -0,0 +1,37 @@
|
||||
" Author: 0xHyoga <0xHyoga@gmx.com>
|
||||
" Description: Report starknet-compile errors in cairo code
|
||||
|
||||
call ale#Set('cairo_starknet_executable', 'starknet-compile')
|
||||
call ale#Set('cairo_starknet_options', '')
|
||||
|
||||
function! ale_linters#cairo#starknet#Handle(buffer, lines) abort
|
||||
" Error always on the first line
|
||||
" e.g ex01.cairo:20:6: Could not find module 'contracts.utils.ex00_base'. Searched in the following paths:
|
||||
let l:pattern = '\v\.cairo:(\d+):(\d+):+ (.*)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': str2nr(l:match[1]),
|
||||
\ 'col': str2nr(l:match[2]),
|
||||
\ 'type': 'E',
|
||||
\ 'text': l:match[3],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cairo#starknet#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'cairo_starknet_executable')
|
||||
|
||||
return l:executable . ale#Pad(ale#Var(a:buffer, 'cairo_starknet_options')) . ' %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cairo', {
|
||||
\ 'name': 'starknet',
|
||||
\ 'executable': {b -> ale#Var(b, 'cairo_starknet_executable')},
|
||||
\ 'command': function('ale_linters#cairo#starknet#GetCommand'),
|
||||
\ 'callback': 'ale_linters#cairo#starknet#Handle',
|
||||
\ 'output_stream': 'stderr',
|
||||
\})
|
@ -4,15 +4,16 @@
|
||||
call ale#Set('dart_analyze_executable', 'dart')
|
||||
|
||||
function! ale_linters#dart#dart_analyze#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v^ ([a-z]+) - (.+):(\d+):(\d+) - (.+) - (.+)$'
|
||||
let l:pattern = '\v([a-z]+) - (.+):(\d+):(\d+) - (.+) - (.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let [l:type, l:filename, l:lnum, l:col, l:message, l:code] = l:match[1:6]
|
||||
call add(l:output, {
|
||||
\ 'type': l:match[1] is# 'error' ? 'E' : 'W',
|
||||
\ 'text': l:match[6] . ': ' . l:match[5],
|
||||
\ 'lnum': str2nr(l:match[3]),
|
||||
\ 'col': str2nr(l:match[4]),
|
||||
\ 'type': l:type is# 'error' ? 'E' : l:type is# 'info' ? 'I' : 'W',
|
||||
\ 'text': l:code . ': ' . l:message,
|
||||
\ 'lnum': str2nr(l:lnum),
|
||||
\ 'col': str2nr(l:col),
|
||||
\})
|
||||
endfor
|
||||
|
||||
@ -22,7 +23,7 @@ endfunction
|
||||
call ale#linter#Define('dart', {
|
||||
\ 'name': 'dart_analyze',
|
||||
\ 'executable': {b -> ale#Var(b, 'dart_analyze_executable')},
|
||||
\ 'command': '%e analyze %s',
|
||||
\ 'command': '%e analyze --fatal-infos %s',
|
||||
\ 'callback': 'ale_linters#dart#dart_analyze#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
24
sources_non_forked/ale/ale_linters/openscad/sca2d.vim
Normal file
24
sources_non_forked/ale/ale_linters/openscad/sca2d.vim
Normal file
@ -0,0 +1,24 @@
|
||||
" Description: SCA2D linter for OpenSCAD files
|
||||
|
||||
call ale#Set('openscad_sca2d_executable', 'sca2d')
|
||||
call ale#Set('openscad_sca2d_options', '')
|
||||
|
||||
function! ale_linters#openscad#sca2d#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'openscad_sca2d_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#openscad#sca2d#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#openscad#sca2d#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'openscad_sca2d_options')
|
||||
|
||||
return ale#Escape(l:executable) . ale#Pad(l:options) . ' %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('openscad', {
|
||||
\ 'name': 'SCA2D',
|
||||
\ 'aliases': ['sca2d'],
|
||||
\ 'executable': function('ale_linters#openscad#sca2d#GetExecutable'),
|
||||
\ 'command': function('ale_linters#openscad#sca2d#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#openscad#SCA2D_callback',
|
||||
\ 'lint_file': 1,
|
||||
\ })
|
@ -1,6 +1,7 @@
|
||||
" Author: bretello <bretello@distruzione.org>
|
||||
|
||||
call ale#Set('yaml_actionlint_executable', 'actionlint')
|
||||
call ale#Set('yaml_actionlint_options', '')
|
||||
|
||||
call ale#linter#Define('yaml', {
|
||||
\ 'name': 'actionlint',
|
||||
|
Reference in New Issue
Block a user