commit: c81bc6cde6a37c9f590a5f9a42346fe1f5fd220e Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> AuthorDate: Fri Jan 20 14:59:55 2023 +0000 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> CommitDate: Fri Jan 20 14:59:55 2023 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=c81bc6cd
EmptyDirsCheck: mark results' level as error This check is done at repo level, so if you are inside a package dir, it will be skipped. As a solution, mark those results as errors, so the bot will fail to regen metadata and we can notice the issue. Resolves: https://github.com/pkgcore/pkgcheck/issues/499 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> src/pkgcheck/checks/repo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pkgcheck/checks/repo.py b/src/pkgcheck/checks/repo.py index 8b12f68d..eefc523e 100644 --- a/src/pkgcheck/checks/repo.py +++ b/src/pkgcheck/checks/repo.py @@ -50,7 +50,7 @@ class RepoDirCheck(GentooRepoCheck, RepoCheck): yield BinaryFile(rel_path) -class EmptyCategoryDir(results.CategoryResult, results.Warning): +class EmptyCategoryDir(results.CategoryResult, results.Error): """Empty category directory in the repository.""" scope = base.repo_scope @@ -60,7 +60,7 @@ class EmptyCategoryDir(results.CategoryResult, results.Warning): return f"empty category directory: {self.category}" -class EmptyPackageDir(results.PackageResult, results.Warning): +class EmptyPackageDir(results.PackageResult, results.Error): """Empty package directory in the repository.""" scope = base.repo_scope @@ -74,7 +74,7 @@ class EmptyDirsCheck(GentooRepoCheck, RepoCheck): """Scan for empty category or package directories.""" _source = (sources.EmptySource, (base.repo_scope,)) - known_results = frozenset([EmptyCategoryDir, EmptyPackageDir]) + known_results = frozenset({EmptyCategoryDir, EmptyPackageDir}) def __init__(self, *args): super().__init__(*args)