Skip to content

Commit 679d095

Browse files
committed
InheritsCheck: Whitelist branding.eclass from UnusedInherits
It can be used purely for variables recognised by external build tools rather than the ebuild itself. Resolves: #765 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
1 parent fafa9c4 commit 679d095

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/pkgcheck/checks/codingstyle.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,10 @@ class InheritsCheck(Check):
817817
)
818818
required_addons = (addons.eclass.EclassAddon,)
819819

820+
# branding.eclass can be used purely for variables recognised by external
821+
# build tools rather than the ebuild itself.
822+
unused_whitelist = frozenset({"branding"})
823+
820824
def __init__(self, *args, eclass_addon):
821825
super().__init__(*args)
822826
self.eclass_cache = eclass_addon.eclasses
@@ -961,7 +965,11 @@ def feed(self, pkg):
961965
)
962966
if exported_eclass_keys.intersection(self.unused_eclass_skiplist):
963967
unused.discard(eclass)
964-
elif not self.eclass_cache[eclass].exported_function_names and exported_eclass_keys:
968+
elif (
969+
not self.eclass_cache[eclass].exported_function_names
970+
and exported_eclass_keys
971+
or eclass in self.unused_whitelist
972+
):
965973
# ignore eclasses that export ebuild metadata (e.g.
966974
# SRC_URI, S, ...) and no functions
967975
unused.discard(eclass)

0 commit comments

Comments
 (0)