Add oelint-adv support (#4043)

This commit is contained in:
offa
2022-02-06 05:08:10 +00:00
committed by GitHub
parent 0c276aac90
commit 7cbb68da6c
7 changed files with 125 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
Before:
runtime ale_linters/bitbake/oelint_adv.vim
After:
Restore
call ale#linter#Reset()
Execute(The oelint_adv handler should handle warnings):
AssertEqual
\ [
\ {
\ 'lnum': 1234,
\ 'type': 'I',
\ 'code': 'oelint.var.suggestedvar.BUGTRACKER',
\ 'text': 'Variable ''BUGTRACKER'' should be set',
\ },
\ {
\ 'lnum': 17,
\ 'type': 'E',
\ 'code': 'oelint.var.mandatoryvar.DESCRIPTION',
\ 'text': 'Variable ''DESCRIPTION'' should be set',
\ },
\ ],
\ ale_linters#bitbake#oelint_adv#Handle(1, [
\ '/meta-x/recipes-y/example/example_1.0.bb:1234:info:oelint.var.suggestedvar.BUGTRACKER:Variable ''BUGTRACKER'' should be set',
\ 'example2_1.1.bb:17:error:oelint.var.mandatoryvar.DESCRIPTION:Variable ''DESCRIPTION'' should be set',
\ ])

13
test/linter/test_bitbake.vader Executable file
View File

@@ -0,0 +1,13 @@
Before:
call ale#assert#SetUpLinterTest('bitbake', 'oelint_adv')
After:
call ale#assert#TearDownLinterTest()
Execute(The default command should be correct):
AssertLinter 'oelint-adv', ale#Escape('oelint-adv') . ' --quiet %s'
Execute(The executable should be configurable):
let b:ale_bitbake_oelint_adv_executable = 'xyz'
AssertLinter 'xyz', ale#Escape('xyz') . ' --quiet %s'