Subject: bug#73434: closed (Re: bug#73434: Acknowledgement ([PATCH] lint: Check for minimal variants.))

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 29 Sep 2024 16:13:04 +0000

Your bug report

#73434: [PATCH] lint: Check for minimal variants.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
73434: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73434
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#73434: Acknowledgement ([PATCH] lint: Check for minimal variants.)
From: Efraim Flashner <[email-masked]>
To: [email-masked]
Date: Sun, 29 Sep 2024 19:11:15 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Patch pushed

-- 
Efraim Flashner   <[email-masked]>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

Subject: [PATCH] lint: Check for minimal variants.
From: Efraim Flashner <[email-masked]>
To: [email-masked]
Cc: Efraim Flashner <[email-masked]>
Date: Mon, 23 Sep 2024 10:56:01 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

* guix/lint.scm (check-inputs-should-use-a-minimal-variant): New
procedure.
(%local-checkers): Add it.

Change-Id: Ifbf808063e4e125c7070505a8a6215128d84b40b
---
 guix/lint.scm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/guix/lint.scm b/guix/lint.scm
index 7612832a5a6..8c6c20c7237 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2016 Hartmut Goebel <[email-masked]>
 ;;; Copyright © 2017 Alex Kost <[email-masked]>
 ;;; Copyright © 2017, 2021 Tobias Geerinckx-Rice <[email-masked]>
-;;; Copyright © 2017, 2018, 2020 Efraim Flashner <[email-masked]>
+;;; Copyright © 2017, 2018, 2020, 2024 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2018, 2019 Arun Isaac <[email-masked]>
 ;;; Copyright © 2020 Chris Marusich <[email-masked]>
 ;;; Copyright © 2020 Timothy Sample <[email-masked]>
@@ -96,6 +96,7 @@ (define-module (guix lint)
   #:export (check-description-style
             check-inputs-should-be-native
             check-inputs-should-not-be-an-input-at-all
+            check-inputs-should-use-a-minimal-variant
             check-input-labels
             check-wrapper-inputs
             check-patch-file-names
@@ -598,6 +599,21 @@ (define (check-inputs-should-not-be-an-input-at-all package)
          (package-input-intersection (package-direct-inputs package)
                                      input-names))))
 
+(define (check-inputs-should-use-a-minimal-variant package)
+  ;; Emit a warning if some inputs of PACKAGE should likely be replaced
+  ;; with their minimal variant.
+  (let ((input-names '("bash"
+                       "cmake"
+                       "gettext")))
+    (map (lambda (input)
+           (make-warning
+            package
+            (G_ "'~a' should probably switched for its minimal variant")
+            (list input)
+            #:field 'inputs))
+         (package-input-intersection (package-direct-inputs package)
+                                     input-names))))
+
 (define (check-input-labels package)
   "Emit a warning for labels that differ from the corresponding package name."
   (define (check input-kind package-inputs)
@@ -1978,6 +1994,10 @@ (define %local-checkers
      (name        'inputs-should-not-be-input)
      (description "Identify inputs that shouldn't be inputs at all")
      (check       check-inputs-should-not-be-an-input-at-all))
+   (lint-checker
+     (name        'inputs-should-be-minimal)
+     (description "Identify inputs that should use their minimal variant")
+     (check       check-inputs-should-use-a-minimal-variant))
    (lint-checker
      (name        'input-labels)
      (description "Identify input labels that do not match package names")

base-commit: 41e408eb1f93d96b549d345e2de74143220b7b76
-- 
Efraim Flashner   <[email-masked]>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted