All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Author: Carl Smedstad <carl.smedstad at protonmail dot com>
2 " Description: bicep for bicep files
4 let g:ale_bicep_bicep_executable =
5 \ get(g:, 'ale_bicep_bicep_executable', 'bicep')
7 let g:ale_bicep_bicep_options =
8 \ get(g:, 'ale_bicep_bicep_options', '')
10 function! ale_linters#bicep#bicep#Executable(buffer) abort
11 return ale#Var(a:buffer, 'bicep_bicep_executable')
14 function! ale_linters#bicep#bicep#Command(buffer) abort
15 let l:executable = ale_linters#bicep#bicep#Executable(a:buffer)
16 let l:options = ale#Var(a:buffer, 'bicep_bicep_options')
19 let l:nullfile = 'NUL'
21 let l:nullfile = '/dev/null'
24 return ale#Escape(l:executable)
25 \ . ' build --outfile '
32 function! ale_linters#bicep#bicep#Handle(buffer, lines) abort
33 let l:pattern = '\v^(.*)\((\d+),(\d+)\)\s:\s([a-zA-Z]*)\s([-a-zA-Z0-9]*):\s(.*)'
36 for l:match in ale#util#GetMatches(a:lines, l:pattern)
37 if l:match[4] is# 'Error'
39 elseif l:match[4] is# 'Warning'
46 \ 'filename': l:match[1],
47 \ 'lnum': l:match[2] + 0,
48 \ 'col': l:match[3] + 0,
58 call ale#linter#Define('bicep', {
60 \ 'executable': function('ale_linters#bicep#bicep#Executable'),
61 \ 'command': function('ale_linters#bicep#bicep#Command'),
62 \ 'callback': 'ale_linters#bicep#bicep#Handle',
63 \ 'output_stream': 'both',