commit:     6bb4201548e378bb2001610726022de50c79e711
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 18 15:03:54 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 18 15:03:54 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=6bb42015

UnknownCategoryDirs: enable for overlays, ignore scripts dir

Resolves: https://github.com/pkgcore/pkgcheck/issues/564
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgcheck/checks/profiles.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/pkgcheck/checks/profiles.py b/src/pkgcheck/checks/profiles.py
index a0b8c618..5394dca7 100644
--- a/src/pkgcheck/checks/profiles.py
+++ b/src/pkgcheck/checks/profiles.py
@@ -536,7 +536,7 @@ class RepoProfilesCheck(RepoCheck):
     _source = (sources.EmptySource, (base.profiles_scope,))
     required_addons = (addons.profiles.ProfileAddon,)
     known_results = frozenset(
-        [
+        {
             ArchesWithoutProfiles,
             UnusedProfileDirs,
             NonexistentProfilePath,
@@ -548,11 +548,13 @@ class RepoProfilesCheck(RepoCheck):
             BannedProfileEapi,
             DeprecatedProfileEapi,
             ArchesOutOfSync,
-        ]
+        }
     )
 
     # known profile status types for the gentoo repo
-    known_profile_statuses = frozenset(["stable", "dev", "exp"])
+    known_profile_statuses = frozenset({"stable", "dev", "exp"})
+
+    unknown_categories_whitelist = ("scripts",)
 
     def __init__(self, *args, profile_addon):
         super().__init__(*args)
@@ -562,11 +564,10 @@ class RepoProfilesCheck(RepoCheck):
         self.non_profile_dirs = profile_addon.non_profile_dirs
 
     def finish(self):
-        if self.options.gentoo_repo:
-            if unknown_category_dirs := 
set(self.repo.category_dirs).difference(
-                self.repo.categories
-            ):
-                yield UnknownCategoryDirs(sorted(unknown_category_dirs))
+        if unknown_category_dirs := set(self.repo.category_dirs).difference(
+            self.repo.categories, self.unknown_categories_whitelist
+        ):
+            yield UnknownCategoryDirs(sorted(unknown_category_dirs))
         if nonexistent_categories := 
set(self.repo.config.categories).difference(
             self.repo.category_dirs
         ):

Reply via email to