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.
2 " Description: oelint-adv for BitBake files
4 call ale#Set('bitbake_oelint_adv_executable', 'oelint-adv')
5 call ale#Set('bitbake_oelint_adv_options', '')
6 call ale#Set('bitbake_oelint_adv_config', '.oelint.cfg')
8 function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
9 let l:config_file = ale#path#FindNearestFile(a:buffer,
10 \ ale#Var(a:buffer, 'bitbake_oelint_adv_config'))
12 return ((!empty(l:config_file))
13 \ ? 'OELINT_CONFIG=' . ale#Escape(l:config_file) . ' '
16 \ . ale#Pad(ale#Var(a:buffer, 'bitbake_oelint_adv_options')) . '%s'
19 function! ale_linters#bitbake#oelint_adv#Handle(buffer, lines) abort
20 let l:pattern = '\v^(.+):(.+):(.+):(.+):(.+)$'
23 for l:match in ale#util#GetMatches(a:lines, l:pattern)
25 \ 'lnum': str2nr(l:match[2]),
26 \ 'type': l:match[3] is# 'error'
27 \ ? 'E' : (l:match[3] is# 'warning' ? 'W' : 'I'),
28 \ 'text': StripAnsiCodes(l:match[5]),
36 function! StripAnsiCodes(line) abort
37 return substitute(a:line, '\e\[[0-9;]\+[mK]', '', 'g')
40 call ale#linter#Define('bitbake', {
41 \ 'name': 'oelint_adv',
42 \ 'output_stream': 'both',
43 \ 'executable': {b -> ale#Var(b, 'bitbake_oelint_adv_executable')},
45 \ 'command': function('ale_linters#bitbake#oelint_adv#Command'),
46 \ 'callback': 'ale_linters#bitbake#oelint_adv#Handle',