public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: src/pkgcheck/scripts/, src/pkgcheck/checks/, .github/workflows/, src/pkgcheck/, ...
@ 2025-05-31 10:59 Arthur Zamarin
  0 siblings, 0 replies; only message in thread
From: Arthur Zamarin @ 2025-05-31 10:59 UTC (permalink / raw
  To: gentoo-commits

commit:     df472e75e8ad3425705f77dd29cb98a178448092
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat May 31 10:57:46 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat May 31 10:58:29 2025 +0000
URL:        https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=df472e75

use ruff as formatter

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .github/workflows/test.yml          |   4 +-
 Makefile                            |   2 +-
 pyproject.toml                      |   4 +
 src/pkgcheck/addons/git.py          |   2 +-
 src/pkgcheck/checks/acct.py         |   2 +-
 src/pkgcheck/checks/codingstyle.py  |   5 +-
 src/pkgcheck/checks/metadata.py     |  20 ++--
 src/pkgcheck/checks/profiles.py     |   3 +-
 src/pkgcheck/checks/python.py       |   4 +-
 src/pkgcheck/checks/visibility.py   |   5 +-
 src/pkgcheck/feeds.py               |   2 +-
 src/pkgcheck/reporters.py           |   8 +-
 src/pkgcheck/scripts/argparsers.py  |   2 +-
 tests/checks/test_codingstyle.py    |   8 +-
 tests/checks/test_metadata.py       |   4 +-
 tests/checks/test_python.py         | 214 +++++++++++++-----------------------
 tests/checks/test_whitespace.py     |   6 +-
 tests/scripts/test_pkgcheck_scan.py |   6 +-
 18 files changed, 118 insertions(+), 183 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 150ff0f0..4db1dcca 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -108,4 +108,6 @@ jobs:
     steps:
     - name: Checkout code
       uses: actions/checkout@v4
-    - uses: psf/black@stable
+    - uses: astral-sh/ruff-action@v3
+      with:
+        args: "format --check --diff"

diff --git a/Makefile b/Makefile
index 1d48fcb2..63b08eea 100644
--- a/Makefile
+++ b/Makefile
@@ -15,4 +15,4 @@ clean:
 
 .PHONY: format
 format:
-	$(PYTHON) -m black .
+	$(PYTHON) -m ruff format

diff --git a/pyproject.toml b/pyproject.toml
index 4e7d2d82..5f2e94f7 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -89,6 +89,10 @@ exclude = [
 	"doc/api/", "doc/generated/", "doc/_build/",
 ]
 
+[tool.ruff]
+line-length = 100
+target-version = "py311"
+
 [tool.black]
 line-length = 100
 

diff --git a/src/pkgcheck/addons/git.py b/src/pkgcheck/addons/git.py
index e3de52c0..302c5bc1 100644
--- a/src/pkgcheck/addons/git.py
+++ b/src/pkgcheck/addons/git.py
@@ -646,7 +646,7 @@ class GitAddon(caches.CachedAddon):
                 # skip cache usage when not running on the default branch
                 if branch != default_branch:
                     logger.debug(
-                        "skipping %s git repo cache update on " "non-default branch %r",
+                        "skipping %s git repo cache update on non-default branch %r",
                         repo,
                         branch,
                     )

diff --git a/src/pkgcheck/checks/acct.py b/src/pkgcheck/checks/acct.py
index 30953c89..47015953 100644
--- a/src/pkgcheck/checks/acct.py
+++ b/src/pkgcheck/checks/acct.py
@@ -55,7 +55,7 @@ class OutsideRangeAccountIdentifier(results.VersionResult, results.Error):
 
     @property
     def desc(self):
-        return f"{self.kind} id {self.identifier} outside permitted " f"static allocation range"
+        return f"{self.kind} id {self.identifier} outside permitted static allocation range"
 
 
 class AcctCheck(GentooRepoCheck, RepoCheck):

diff --git a/src/pkgcheck/checks/codingstyle.py b/src/pkgcheck/checks/codingstyle.py
index d5473616..b2126429 100644
--- a/src/pkgcheck/checks/codingstyle.py
+++ b/src/pkgcheck/checks/codingstyle.py
@@ -356,10 +356,7 @@ class DeprecatedInsinto(results.LineResult, results.Warning):
 
     @property
     def desc(self):
-        return (
-            f"deprecated insinto usage (use {self.cmd} instead), "
-            f"line {self.lineno}: {self.line}"
-        )
+        return f"deprecated insinto usage (use {self.cmd} instead), line {self.lineno}: {self.line}"
 
 
 class InsintoCheck(Check):

diff --git a/src/pkgcheck/checks/metadata.py b/src/pkgcheck/checks/metadata.py
index e375ba1f..f20d20e2 100644
--- a/src/pkgcheck/checks/metadata.py
+++ b/src/pkgcheck/checks/metadata.py
@@ -77,9 +77,7 @@ class MissingLicenseRestricts(results.VersionResult, results.Warning):
     @property
     def desc(self):
         restrictions = " ".join(self.restrictions)
-        return (
-            f"{self.license_group} license {self.license!r} " f'requires RESTRICT="{restrictions}"'
-        )
+        return f'{self.license_group} license {self.license!r} requires RESTRICT="{restrictions}"'
 
 
 class UnnecessaryLicense(results.VersionResult, results.Warning):
@@ -374,8 +372,7 @@ class RequiredUseDefaults(results.VersionResult, results.Warning):
                 num_profiles = ""
             # collapsed version
             return (
-                f"profile: {self.profile!r}{num_profiles} "
-                f"failed REQUIRED_USE: {self.required_use}"
+                f"profile: {self.profile!r}{num_profiles} failed REQUIRED_USE: {self.required_use}"
             )
         return (
             f"keyword: {self.keyword}, profile: {self.profile!r}, "
@@ -707,7 +704,7 @@ class MissingSlotDep(results.VersionResult, results.Warning):
 
     @property
     def desc(self):
-        return f"{self.dep!r} matches more than one slot: " f"[ {', '.join(self.dep_slots)} ]"
+        return f"{self.dep!r} matches more than one slot: [ {', '.join(self.dep_slots)} ]"
 
 
 class MissingSlotDepCheck(Check):
@@ -782,8 +779,7 @@ class MissingUseDepDefault(results.VersionResult, results.Warning):
         s = pluralism(self.pkgs)
         pkgs = ", ".join(self.pkgs)
         return (
-            f'{self.attr}="{self.atom}": USE flag {self.flag!r} missing from '
-            f"package{s}: [ {pkgs} ]"
+            f'{self.attr}="{self.atom}": USE flag {self.flag!r} missing from package{s}: [ {pkgs} ]'
         )
 
 
@@ -1009,8 +1005,7 @@ class OutdatedBlocker(results.VersionResult, results.Info):
     @property
     def desc(self):
         return (
-            f'outdated blocker {self.attr}="{self.atom}": '
-            f"last match removed {self.age} years ago"
+            f'outdated blocker {self.attr}="{self.atom}": last match removed {self.age} years ago'
         )
 
 
@@ -1030,7 +1025,7 @@ class NonexistentBlocker(results.VersionResult, results.Warning):
 
     @property
     def desc(self):
-        return f'nonexistent blocker {self.attr}="{self.atom}": ' "no matches in repo history"
+        return f'nonexistent blocker {self.attr}="{self.atom}": no matches in repo history'
 
 
 class OutdatedBlockersCheck(Check):
@@ -1564,8 +1559,7 @@ class HomepageCheck(Check):
                             yield BadHomepage(f"HOMEPAGE={homepage!r} lacks protocol", pkg=pkg)
                         elif homepage[:i] not in SrcUriCheck.valid_protos:
                             yield BadHomepage(
-                                f"HOMEPAGE={homepage!r} uses unsupported "
-                                f"protocol {homepage[:i]!r}",
+                                f"HOMEPAGE={homepage!r} uses unsupported protocol {homepage[:i]!r}",
                                 pkg=pkg,
                             )
 

diff --git a/src/pkgcheck/checks/profiles.py b/src/pkgcheck/checks/profiles.py
index 6b3db0c5..faf3c310 100644
--- a/src/pkgcheck/checks/profiles.py
+++ b/src/pkgcheck/checks/profiles.py
@@ -284,8 +284,7 @@ class ProfilesCheck(Check):
                 addons.profiles.ProfileNode(pjoin(self.profiles_dir, replacement))
             except profiles_mod.ProfileError:
                 yield ProfileError(
-                    f"nonexistent replacement {replacement!r} "
-                    f"for deprecated profile: {node.name!r}"
+                    f"nonexistent replacement {replacement!r} for deprecated profile: {node.name!r}"
                 )
 
     # non-spec files

diff --git a/src/pkgcheck/checks/python.py b/src/pkgcheck/checks/python.py
index 5969f136..bc5c71bb 100644
--- a/src/pkgcheck/checks/python.py
+++ b/src/pkgcheck/checks/python.py
@@ -727,9 +727,7 @@ class PythonGHDistfileSuffix(results.VersionResult, results.Warning):
 
     @property
     def desc(self):
-        return (
-            f"GitHub archive {self.filename!r} ({self.uri!r}) is not " "using '.gh.tar.gz' suffix"
-        )
+        return f"GitHub archive {self.filename!r} ({self.uri!r}) is not using '.gh.tar.gz' suffix"
 
 
 class PythonInlinePyPIURI(results.VersionResult, results.Warning):

diff --git a/src/pkgcheck/checks/visibility.py b/src/pkgcheck/checks/visibility.py
index bddbbe64..f7238c76 100644
--- a/src/pkgcheck/checks/visibility.py
+++ b/src/pkgcheck/checks/visibility.py
@@ -12,7 +12,7 @@ from . import Check
 
 
 class FakeConfigurable:
-    "Package wrapper binding profile data." ""
+    "Package wrapper binding profile data."
 
     configurable = True
     __slots__ = ("use", "iuse", "_forced_use", "_masked_use", "_pkg_use", "_raw_pkg", "_profile")
@@ -114,8 +114,7 @@ class VisibleVcsPkg(results.VersionResult, results.Warning):
             num_profiles = ""
 
         return (
-            f'VCS version visible for KEYWORDS="{self.arch}", '
-            f"profile {self.profile}{num_profiles}"
+            f'VCS version visible for KEYWORDS="{self.arch}", profile {self.profile}{num_profiles}'
         )
 
 

diff --git a/src/pkgcheck/feeds.py b/src/pkgcheck/feeds.py
index e09874dc..1a0ce9bd 100644
--- a/src/pkgcheck/feeds.py
+++ b/src/pkgcheck/feeds.py
@@ -46,7 +46,7 @@ class QueryCache(Feed):
             dest="query_caching_freq",
             choices=("version", "package", "category"),
             default="package",
-            help="control how often the cache is cleared " "(version, package or category)",
+            help="control how often the cache is cleared (version, package or category)",
         )
 
     @staticmethod

diff --git a/src/pkgcheck/reporters.py b/src/pkgcheck/reporters.py
index cf6d9b2b..87e8d136 100644
--- a/src/pkgcheck/reporters.py
+++ b/src/pkgcheck/reporters.py
@@ -319,12 +319,12 @@ class FlycheckReporter(Reporter):
     def _process_report(self):
         while True:
             result = yield
-            file = f'{getattr(result, "package", "")}-{getattr(result, "version", "")}.ebuild'
-            message = f'{getattr(result, "name")}: {getattr(result, "desc")}'
+            file = f"{getattr(result, 'package', '')}-{getattr(result, 'version', '')}.ebuild"
+            message = f"{getattr(result, 'name')}: {getattr(result, 'desc')}"
             if isinstance(result, BaseLinesResult):
                 message = message.replace(result.lines_str, "").strip()
                 for lineno in result.lines:
-                    self.out.write(f'{file}:{lineno}:{getattr(result, "level")}:{message}')
+                    self.out.write(f"{file}:{lineno}:{getattr(result, 'level')}:{message}")
             else:
                 lineno = getattr(result, "lineno", 0)
-                self.out.write(f'{file}:{lineno}:{getattr(result, "level")}:{message}')
+                self.out.write(f"{file}:{lineno}:{getattr(result, 'level')}:{message}")

diff --git a/src/pkgcheck/scripts/argparsers.py b/src/pkgcheck/scripts/argparsers.py
index 0fd349d7..9c50aade 100644
--- a/src/pkgcheck/scripts/argparsers.py
+++ b/src/pkgcheck/scripts/argparsers.py
@@ -56,7 +56,7 @@ def _setup_reporter(parser, namespace):
             namespace.reporter = objects.REPORTERS[namespace.reporter]
         except KeyError:
             available = ", ".join(objects.REPORTERS)
-            parser.error(f"no reporter matches {namespace.reporter!r} " f"(available: {available})")
+            parser.error(f"no reporter matches {namespace.reporter!r} (available: {available})")
 
     if namespace.reporter is reporters.FormatReporter:
         if not namespace.format_str:

diff --git a/tests/checks/test_codingstyle.py b/tests/checks/test_codingstyle.py
index b6de0c12..72641667 100644
--- a/tests/checks/test_codingstyle.py
+++ b/tests/checks/test_codingstyle.py
@@ -438,7 +438,7 @@ class TestExcessiveLineLength(misc.ReportTestCase):
     def test_long_line(self):
         r = self.assertReport(
             self.check,
-            self._prepare_pkg(f'echo {"a " * codingstyle.ExcessiveLineLength.line_length}'),
+            self._prepare_pkg(f"echo {'a ' * codingstyle.ExcessiveLineLength.line_length}"),
         )
         assert r.lines == (1,)
 
@@ -446,9 +446,9 @@ class TestExcessiveLineLength(misc.ReportTestCase):
         r = self.assertReport(
             self.check,
             self._prepare_pkg(
-                f'echo {"a " * codingstyle.ExcessiveLineLength.line_length}',
+                f"echo {'a ' * codingstyle.ExcessiveLineLength.line_length}",
                 'echo "short line"',
-                f'echo {"Hello " * codingstyle.ExcessiveLineLength.line_length}',
+                f"echo {'Hello ' * codingstyle.ExcessiveLineLength.line_length}",
             ),
         )
         assert r.lines == (1, 3)
@@ -470,7 +470,7 @@ class TestExcessiveLineLength(misc.ReportTestCase):
         r = self.assertReport(
             self.check,
             self._prepare_pkg(
-                f'echo {"a" * codingstyle.ExcessiveLineLength.line_length}',
+                f"echo {'a' * codingstyle.ExcessiveLineLength.line_length}",
                 f"echo {medium_word} {long_word}",
                 f"echo {medium_word} {long_word[:-5]}",
             ),

diff --git a/tests/checks/test_metadata.py b/tests/checks/test_metadata.py
index 55825307..5e336633 100644
--- a/tests/checks/test_metadata.py
+++ b/tests/checks/test_metadata.py
@@ -115,8 +115,8 @@ class IUSE_Options(misc.Tmpdir):
                 textwrap.dedent(
                     f"""\
                         masters =
-                        properties-allowed = {' '.join(properties)}
-                        restrict-allowed = {' '.join(restrict)}
+                        properties-allowed = {" ".join(properties)}
+                        restrict-allowed = {" ".join(restrict)}
                     """
                 )
             )

diff --git a/tests/checks/test_python.py b/tests/checks/test_python.py
index 268c4d4d..2eaede7d 100644
--- a/tests/checks/test_python.py
+++ b/tests/checks/test_python.py
@@ -133,12 +133,10 @@ class TestPythonCheck(misc.ReportTestCase):
             self.check,
             self.mk_pkg(
                 _eclasses_=["python-r1"],
-                IUSE="python_targets_python3_5 " "python_targets_python3_6",
-                RDEPEND="python_targets_python3_5? ( "
-                "  dev-lang/python:3.5 ) "
-                "python_targets_python3_6? ( "
-                "  dev-lang/python:3.6 )",
-                REQUIRED_USE="|| ( python_targets_python3_5 " "     python_targets_python3_6 )",
+                IUSE="python_targets_python3_5 python_targets_python3_6",
+                RDEPEND="python_targets_python3_5? ( dev-lang/python:3.5 ) "
+                "python_targets_python3_6? ( dev-lang/python:3.6 )",
+                REQUIRED_USE="|| ( python_targets_python3_5 python_targets_python3_6 )",
             ),
         )
 
@@ -148,7 +146,7 @@ class TestPythonCheck(misc.ReportTestCase):
             self.mk_pkg(
                 _eclasses_=["python-single-r1"],
                 IUSE="python_targets_python3_5",
-                RDEPEND="python_targets_python3_5? ( " "  dev-lang/python:3.5 )",
+                RDEPEND="python_targets_python3_5? ( dev-lang/python:3.5 )",
                 REQUIRED_USE="python_targets_python3_5",
             ),
         )
@@ -177,7 +175,7 @@ class TestPythonCheck(misc.ReportTestCase):
             self.check,
             self.mk_pkg(
                 _eclasses_=["python-any-r1"],
-                DEPEND="|| ( " "  dev-lang/python:3.5 " "  dev-lang/python:3.6 )",
+                DEPEND="|| ( dev-lang/python:3.5 dev-lang/python:3.6 )",
             ),
         )
         self.assertNoReport(
@@ -187,7 +185,7 @@ class TestPythonCheck(misc.ReportTestCase):
             self.check,
             self.mk_pkg(
                 _eclasses_=["python-any-r1"],
-                BDEPEND="|| ( " "  dev-lang/python:3.5 " "  dev-lang/python:3.6 )",
+                BDEPEND="|| ( dev-lang/python:3.5 dev-lang/python:3.6 )",
             ),
         )
 
@@ -196,11 +194,9 @@ class TestPythonCheck(misc.ReportTestCase):
             self.check,
             self.mk_pkg(
                 _eclasses_=["python-r1"],
-                IUSE="python_targets_python3_5 " "python_targets_python3_6",
-                RDEPEND="python_targets_python3_5? ( "
-                "  dev-lang/python:3.5 ) "
-                "python_targets_python3_6? ( "
-                "  dev-lang/python:3.6 )",
+                IUSE="python_targets_python3_5 python_targets_python3_6",
+                RDEPEND="python_targets_python3_5? (  dev-lang/python:3.5 ) "
+                "python_targets_python3_6? ( dev-lang/python:3.6 )",
             ),
         )
         assert isinstance(r, python.PythonMissingRequiredUse)
@@ -212,11 +208,9 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-r1"],
-                    IUSE="python_targets_python3_5 " "python_targets_python3_6",
-                    RDEPEND="python_targets_python3_5? ( "
-                    "  dev-lang/python:3.5 ) "
-                    "python_targets_python3_6? ( "
-                    "  dev-lang/python:3.6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6",
+                    RDEPEND="python_targets_python3_5? ( dev-lang/python:3.5 ) "
+                    "python_targets_python3_6? ( dev-lang/python:3.6 )",
                     REQUIRED_USE="|| ( python_targets_python3_5 )",
                 ),
             ),
@@ -228,16 +222,11 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-r1"],
-                    IUSE="python_targets_python3_5 "
-                    "python_targets_python3_6 "
-                    "python_targets_python3_7",
-                    RDEPEND="python_targets_python3_5? ( "
-                    "  dev-lang/python:3.5 ) "
-                    "python_targets_python3_6? ( "
-                    "  dev-lang/python:3.6 ) "
-                    "python_targets_python3_7? ( "
-                    "  dev-lang/python:3.7 )",
-                    REQUIRED_USE="|| ( python_targets_python3_6 " "  python_targets_python3_7 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6 python_targets_python3_7",
+                    RDEPEND="python_targets_python3_5? ( dev-lang/python:3.5 ) "
+                    "python_targets_python3_6? ( dev-lang/python:3.6 ) "
+                    "python_targets_python3_7? ( dev-lang/python:3.7 )",
+                    REQUIRED_USE="|| ( python_targets_python3_6 python_targets_python3_7 )",
                 ),
             ),
             python.PythonMissingRequiredUse,
@@ -248,14 +237,10 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-single-r1"],
-                    IUSE="python_targets_python3_5 "
-                    "python_targets_python3_6 "
-                    "python_single_target_python3_5 "
-                    "python_single_target_python3_6",
-                    RDEPEND="python_single_target_python3_5? ( "
-                    "  dev-lang/python:3.5 ) "
-                    "python_single_target_python3_6? ( "
-                    "  dev-lang/python:3.6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6 "
+                    "python_single_target_python3_5 python_single_target_python3_6",
+                    RDEPEND="python_single_target_python3_5? ( dev-lang/python:3.5 ) "
+                    "python_single_target_python3_6? ( dev-lang/python:3.6 )",
                 ),
             ),
             python.PythonMissingRequiredUse,
@@ -267,14 +252,10 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-single-r1"],
-                    IUSE="python_targets_python3_5 "
-                    "python_targets_python3_6 "
-                    "python_single_target_python3_5 "
-                    "python_single_target_python3_6",
-                    RDEPEND="python_single_target_python3_5? ( "
-                    "  dev-lang/python:3.5 ) "
-                    "python_single_target_python3_6? ( "
-                    "  dev-lang/python:3.6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6 "
+                    "python_single_target_python3_5 python_single_target_python3_6",
+                    RDEPEND="python_single_target_python3_5? ( dev-lang/python:3.5 ) "
+                    "python_single_target_python3_6? ( dev-lang/python:3.6 )",
                     REQUIRED_USE="^^ ( python_single_target_python3_5 )",
                 ),
             ),
@@ -287,15 +268,11 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-single-r1"],
-                    IUSE="python_targets_python3_5 "
-                    "python_targets_python3_6 "
-                    "python_single_target_python3_5 "
-                    "python_single_target_python3_6",
-                    RDEPEND="python_single_target_python3_5? ( "
-                    "  dev-lang/python:3.5 ) "
-                    "python_single_target_python3_6? ( "
-                    "  dev-lang/python:3.6 )",
-                    REQUIRED_USE="|| ( python_targets_python3_5 " "  python_targets_python3_6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6 "
+                    "python_single_target_python3_5 python_single_target_python3_6",
+                    RDEPEND="python_single_target_python3_5? ( dev-lang/python:3.5 ) "
+                    "python_single_target_python3_6? ( dev-lang/python:3.6 )",
+                    REQUIRED_USE="|| ( python_targets_python3_5 python_targets_python3_6 )",
                 ),
             ),
             python.PythonMissingRequiredUse,
@@ -306,8 +283,8 @@ class TestPythonCheck(misc.ReportTestCase):
             self.check,
             self.mk_pkg(
                 _eclasses_=["python-r1"],
-                IUSE="python_targets_python3_5 " "python_targets_python3_6",
-                REQUIRED_USE="|| ( python_targets_python3_5 " "     python_targets_python3_6 )",
+                IUSE="python_targets_python3_5 python_targets_python3_6",
+                REQUIRED_USE="|| ( python_targets_python3_5 python_targets_python3_6 )",
             ),
         )
         assert isinstance(r, python.PythonMissingDeps)
@@ -318,9 +295,9 @@ class TestPythonCheck(misc.ReportTestCase):
             self.check,
             self.mk_pkg(
                 _eclasses_=["python-r1"],
-                IUSE="python_targets_python3_5 " "python_targets_python3_6",
-                RDEPEND="python_targets_python3_5? ( " "  dev-lang/python:3.5 )",
-                REQUIRED_USE="|| ( python_targets_python3_5 " "     python_targets_python3_6 )",
+                IUSE="python_targets_python3_5 python_targets_python3_6",
+                RDEPEND="python_targets_python3_5? ( dev-lang/python:3.5 )",
+                REQUIRED_USE="|| ( python_targets_python3_5 python_targets_python3_6 )",
             ),
         )
         assert isinstance(r, python.PythonMissingDeps)
@@ -333,12 +310,10 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-r1"],
-                    IUSE="python_targets_python3_5 " "python_targets_python3_6",
-                    RDEPEND="python_targets_python3_5? ( "
-                    "  dev-foo/bar ) "
-                    "python_targets_python3_6? ( "
-                    "  dev-lang/python:3.6 )",
-                    REQUIRED_USE="|| ( python_targets_python3_5 " "     python_targets_python3_6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6",
+                    RDEPEND="python_targets_python3_5? ( dev-foo/bar ) "
+                    "python_targets_python3_6? ( dev-lang/python:3.6 )",
+                    REQUIRED_USE="|| ( python_targets_python3_5 python_targets_python3_6 )",
                 ),
             ),
             python.PythonMissingDeps,
@@ -350,12 +325,10 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-r1"],
-                    IUSE="python_targets_python3_5 " "python_targets_python3_6",
-                    DEPEND="python_targets_python3_5? ( "
-                    "  dev-lang/python:3.5 ) "
-                    "python_targets_python3_6? ( "
-                    "  dev-lang/python:3.6 )",
-                    REQUIRED_USE="|| ( python_targets_python3_5 " "     python_targets_python3_6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6",
+                    DEPEND="python_targets_python3_5? ( dev-lang/python:3.5 ) "
+                    "python_targets_python3_6? ( dev-lang/python:3.6 )",
+                    REQUIRED_USE="|| ( python_targets_python3_5 python_targets_python3_6 )",
                 ),
             ),
             python.PythonMissingDeps,
@@ -366,16 +339,11 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-single-r1"],
-                    IUSE="python_targets_python3_5 "
-                    "python_targets_python3_6 "
-                    "python_single_target_python3_5 "
-                    "python_single_target_python3_6",
-                    REQUIRED_USE="^^ ( python_single_target_python3_5 "
-                    "     python_single_target_python3_6 ) "
-                    "python_single_target_python3_5? ( "
-                    "  python_targets_python3_5 ) "
-                    "python_single_target_python3_6? ( "
-                    "  python_targets_python3_6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6 "
+                    "python_single_target_python3_5 python_single_target_python3_6",
+                    REQUIRED_USE="^^ ( python_single_target_python3_5 python_single_target_python3_6 ) "
+                    "python_single_target_python3_5? ( python_targets_python3_5 ) "
+                    "python_single_target_python3_6? ( python_targets_python3_6 )",
                 ),
             ),
             python.PythonMissingDeps,
@@ -387,17 +355,12 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-single-r1"],
-                    IUSE="python_targets_python3_5 "
-                    "python_targets_python3_6 "
-                    "python_single_target_python3_5 "
-                    "python_single_target_python3_6",
-                    RDEPEND="python_single_target_python3_5? ( " "  dev-lang/python:3.5 )",
-                    REQUIRED_USE="^^ ( python_single_target_python3_5 "
-                    "     python_single_target_python3_6 ) "
-                    "python_single_target_python3_5? ( "
-                    "  python_targets_python3_5 ) "
-                    "python_single_target_python3_6? ( "
-                    "  python_targets_python3_6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6 "
+                    "python_single_target_python3_5 python_single_target_python3_6",
+                    RDEPEND="python_single_target_python3_5? ( dev-lang/python:3.5 )",
+                    REQUIRED_USE="^^ ( python_single_target_python3_5 python_single_target_python3_6 ) "
+                    "python_single_target_python3_5? ( python_targets_python3_5 ) "
+                    "python_single_target_python3_6? ( python_targets_python3_6 )",
                 ),
             ),
             python.PythonMissingDeps,
@@ -410,20 +373,13 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-single-r1"],
-                    IUSE="python_targets_python3_5 "
-                    "python_targets_python3_6 "
-                    "python_single_target_python3_5 "
-                    "python_single_target_python3_6",
-                    RDEPEND="python_single_target_python3_5? ( "
-                    "  dev-foo/bar ) "
-                    "python_single_target_python3_6? ( "
-                    "  dev-lang/python:3.6 )",
-                    REQUIRED_USE="^^ ( python_single_target_python3_5 "
-                    "     python_single_target_python3_6 ) "
-                    "python_single_target_python3_5? ( "
-                    "  python_targets_python3_5 ) "
-                    "python_single_target_python3_6? ( "
-                    "  python_targets_python3_6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6 "
+                    "python_single_target_python3_5 python_single_target_python3_6",
+                    RDEPEND="python_single_target_python3_5? ( dev-foo/bar ) "
+                    "python_single_target_python3_6? ( dev-lang/python:3.6 )",
+                    REQUIRED_USE="^^ ( python_single_target_python3_5 python_single_target_python3_6 ) "
+                    "python_single_target_python3_5? ( python_targets_python3_5 ) "
+                    "python_single_target_python3_6? ( python_targets_python3_6 )",
                 ),
             ),
             python.PythonMissingDeps,
@@ -435,20 +391,13 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-single-r1"],
-                    IUSE="python_targets_python3_5 "
-                    "python_targets_python3_6 "
-                    "python_single_target_python3_5 "
-                    "python_single_target_python3_6",
-                    DEPEND="python_single_target_python3_5? ( "
-                    "  dev-lang/python:3.5 ) "
-                    "python_single_target_python3_6? ( "
-                    "  dev-lang/python:3.6 )",
-                    REQUIRED_USE="^^ ( python_single_target_python3_5 "
-                    "     python_single_target_python3_6 ) "
-                    "python_single_target_python3_5? ( "
-                    "  python_targets_python3_5 ) "
-                    "python_single_target_python3_6? ( "
-                    "  python_targets_python3_6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6 "
+                    "python_single_target_python3_5 python_single_target_python3_6",
+                    DEPEND="python_single_target_python3_5? ( dev-lang/python:3.5 ) "
+                    "python_single_target_python3_6? ( dev-lang/python:3.6 )",
+                    REQUIRED_USE="^^ ( python_single_target_python3_5 python_single_target_python3_6 ) "
+                    "python_single_target_python3_5? ( python_targets_python3_5 ) "
+                    "python_single_target_python3_6? ( python_targets_python3_6 )",
                 ),
             ),
             python.PythonMissingDeps,
@@ -461,20 +410,13 @@ class TestPythonCheck(misc.ReportTestCase):
                 self.check,
                 self.mk_pkg(
                     _eclasses_=["python-single-r1"],
-                    IUSE="python_targets_python3_5 "
-                    "python_targets_python3_6 "
-                    "python_single_target_python3_5 "
-                    "python_single_target_python3_6",
-                    RDEPEND="python_targets_python3_5? ( "
-                    "  dev-lang/python:3.5 ) "
-                    "python_targets_python3_6? ( "
-                    "  dev-lang/python:3.6 )",
-                    REQUIRED_USE="^^ ( python_single_target_python3_5 "
-                    "     python_single_target_python3_6 ) "
-                    "python_single_target_python3_5? ( "
-                    "  python_targets_python3_5 ) "
-                    "python_single_target_python3_6? ( "
-                    "  python_targets_python3_6 )",
+                    IUSE="python_targets_python3_5 python_targets_python3_6 "
+                    "python_single_target_python3_5 python_single_target_python3_6",
+                    RDEPEND="python_targets_python3_5? ( dev-lang/python:3.5 ) "
+                    "python_targets_python3_6? ( dev-lang/python:3.6 )",
+                    REQUIRED_USE="^^ ( python_single_target_python3_5 python_single_target_python3_6 ) "
+                    "python_single_target_python3_5? ( python_targets_python3_5 ) "
+                    "python_single_target_python3_6? ( python_targets_python3_6 )",
                 ),
             ),
             python.PythonMissingDeps,
@@ -490,8 +432,8 @@ class TestPythonCheck(misc.ReportTestCase):
             self.check,
             self.mk_pkg(
                 _eclasses_=["python-any-r1"],
-                DEPEND="|| ( " "  dev-lang/python:3.5 " "  dev-lang/python:3.6 )",
-                RDEPEND="|| ( " "  dev-lang/python:3.5 " "  dev-lang/python:3.6 )",
+                DEPEND="|| ( dev-lang/python:3.5 dev-lang/python:3.6 )",
+                RDEPEND="|| ( dev-lang/python:3.5 dev-lang/python:3.6 )",
             ),
         )
         assert isinstance(r, python.PythonRuntimeDepInAnyR1)

diff --git a/tests/checks/test_whitespace.py b/tests/checks/test_whitespace.py
index e6324d77..7d74440f 100644
--- a/tests/checks/test_whitespace.py
+++ b/tests/checks/test_whitespace.py
@@ -115,9 +115,9 @@ class TestBadWhitespaceCharacter(WhitespaceCheckTest):
         """Check if the hardcoded bad whitespace character list is outdated."""
         updated_whitespace_data = generate_whitespace_data()
         if updated_whitespace_data.unicode_version != whitespace.whitespace_data.unicode_version:
-            assert (
-                updated_whitespace_data.chars == whitespace.whitespace_data.chars
-            ), f"outdated character list for Unicode version {unicodedata.unidata_version}"
+            assert updated_whitespace_data.chars == whitespace.whitespace_data.chars, (
+                f"outdated character list for Unicode version {unicodedata.unidata_version}"
+            )
 
     def test_bad_whitespace_chars(self):
         for char in whitespace.whitespace_data.chars:

diff --git a/tests/scripts/test_pkgcheck_scan.py b/tests/scripts/test_pkgcheck_scan.py
index 7f2c71d5..ca8f37e5 100644
--- a/tests/scripts/test_pkgcheck_scan.py
+++ b/tests/scripts/test_pkgcheck_scan.py
@@ -625,9 +625,9 @@ class TestPkgcheckScan:
                     f"{repo}/{check}/{keyword}/expected-verbose.json"
                 )
                 if expected_verbose_results:
-                    assert self._render_results(
-                        expected_verbose_results
-                    ), "failed rendering verbose results"
+                    assert self._render_results(expected_verbose_results), (
+                        "failed rendering verbose results"
+                    )
                     verbose_results.update(expected_verbose_results)
                 else:
                     verbose_results.update(expected_results)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-31 10:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-31 10:59 [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: src/pkgcheck/scripts/, src/pkgcheck/checks/, .github/workflows/, src/pkgcheck/, Arthur Zamarin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox