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: az_bicep for bicep files
4 let g:ale_bicep_az_bicep_executable =
5 \ get(g:, 'ale_bicep_az_bicep_executable', 'az')
7 let g:ale_bicep_az_bicep_options =
8 \ get(g:, 'ale_bicep_az_bicep_options', '')
10 function! ale_linters#bicep#az_bicep#Executable(buffer) abort
11 return ale#Var(a:buffer, 'bicep_az_bicep_executable')
14 function! ale_linters#bicep#az_bicep#Command(buffer) abort
15 let l:executable = ale_linters#bicep#az_bicep#Executable(a:buffer)
16 let l:options = ale#Var(a:buffer, 'bicep_az_bicep_options')
19 let l:nullfile = 'NUL'
21 let l:nullfile = '/dev/null'
24 return ale#Escape(l:executable)
25 \ . ' bicep build --outfile '
32 function! ale_linters#bicep#az_bicep#Handle(buffer, lines) abort
33 let l:pattern = '\v^([A-Z]+)?(:\s)?(.*)\((\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[1] is# 'ERROR'
39 elseif l:match[1] is# 'WARNING'
41 elseif l:match[6] is# 'Error'
43 elseif l:match[6] is# 'Warning'
50 \ 'filename': l:match[3],
51 \ 'lnum': l:match[4] + 0,
52 \ 'col': l:match[5] + 0,
62 call ale#linter#Define('bicep', {
64 \ 'executable': function('ale_linters#bicep#az_bicep#Executable'),
65 \ 'command': function('ale_linters#bicep#az_bicep#Command'),
66 \ 'callback': 'ale_linters#bicep#az_bicep#Handle',
67 \ 'output_stream': 'stderr',