commit:     a159aca5222ca9ef08087ee7aa16325fe136080a
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  1 15:49:58 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Sep  1 15:49:58 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=a159aca5

checks: use stable sorting of fields + strip where needed

In preparation of new tree-sitter-bash, some small issues where found.

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

 src/pkgcheck/checks/metadata.py | 2 +-
 src/pkgcheck/checks/profiles.py | 4 ++--
 src/pkgcheck/checks/rust.py     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/pkgcheck/checks/metadata.py b/src/pkgcheck/checks/metadata.py
index 555ea9a5..3219036f 100644
--- a/src/pkgcheck/checks/metadata.py
+++ b/src/pkgcheck/checks/metadata.py
@@ -681,7 +681,7 @@ class UseFlagsWithoutEffectsCheck(GentooRepoCheck):
 
         flags = 
self.warn_use_small_files.intersection(pkg.iuse_stripped).difference(used_flags)
         if flags:
-            yield UseFlagWithoutDeps(flags, pkg=pkg)
+            yield UseFlagWithoutDeps(sorted(flags), pkg=pkg)
 
 
 class MissingSlotDep(results.VersionResult, results.Warning):

diff --git a/src/pkgcheck/checks/profiles.py b/src/pkgcheck/checks/profiles.py
index b9108f83..8a8248c7 100644
--- a/src/pkgcheck/checks/profiles.py
+++ b/src/pkgcheck/checks/profiles.py
@@ -303,9 +303,9 @@ class ProfilesCheck(Check):
             for _, disabled, enabled in entries:
                 if unknown_disabled := set(disabled) - self.available_iuse:
                     flags = ("-" + u for u in unknown_disabled)
-                    yield UnknownProfileUse(pjoin(node.name, filename), flags)
+                    yield UnknownProfileUse(pjoin(node.name, filename), 
sorted(flags))
                 if unknown_enabled := set(enabled) - self.available_iuse:
-                    yield UnknownProfileUse(pjoin(node.name, filename), 
unknown_enabled)
+                    yield UnknownProfileUse(pjoin(node.name, filename), 
sorted(unknown_enabled))
 
     @verify_files(
         ("packages", "packages"),

diff --git a/src/pkgcheck/checks/rust.py b/src/pkgcheck/checks/rust.py
index 1a5e6770..397738b9 100644
--- a/src/pkgcheck/checks/rust.py
+++ b/src/pkgcheck/checks/rust.py
@@ -64,7 +64,7 @@ class RustCheck(Check):
             call_name = pkg.node_str(node.child_by_field_name("name"))
             if call_name == "cargo_crate_uris":
                 row, _ = node.start_point
-                line = pkg.node_str(node.parent)
+                line = pkg.node_str(node.parent).strip()
                 if node.child_count == 1 or (
                     node.child_count == 2
                     and any(

Reply via email to