Skip to content

Commit

Permalink
bbclassextend: dont warn on image or packagegroup
Browse files Browse the repository at this point in the history
Usually, one would probably not try to build a -native or -nativesdk
variant of an image or a packagegroup recipe. So skip this warning in
these cases.
  • Loading branch information
amuetzel authored and priv-kweihmann committed Feb 22, 2024
1 parent 1efcfc2 commit 44cf9de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions oelint_adv/rule_base/rule_vars_bbclassextends.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def __init__(self) -> None:
message='BBCLASSEXTEND should be set if possible')

def check(self, _file: str, stash: Stash) -> List[Tuple[str, int, str]]:
if stash.IsPackageGroup(_file) or stash.IsImage(_file):
return []
res = []
items: List[Variable] = stash.GetItemsFor(filename=_file, classifier=Variable.CLASSIFIER,
attribute=Variable.ATTR_VAR, attributeValue='BBCLASSEXTEND')
Expand Down
8 changes: 8 additions & 0 deletions tests/test_class_oelint_var_bbclassextend.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ def test_bad(self, input_, id_, occurrence):
'oelint_adv_test.bb':
'inherit nativesdk',
},
{
'oelint_adv_test.bb':
'inherit core-image',
},
{
'oelint_adv_test.bb':
'inherit packagegroup',
},
],
)
def test_good(self, input_, id_, occurrence):
Expand Down

0 comments on commit 44cf9de

Please sign in to comment.