From: Efraim Flashner <efraim@flashner.co.il>
To: 73434@debbugs.gnu.org
Cc: "Efraim Flashner" <efraim@flashner.co.il>,
"Christopher Baines" <guix@cbaines.net>,
"Josselin Poiret" <dev@jpoiret.xyz>,
"Ludovic Courtès" <ludo@gnu.org>,
"Mathieu Othacehe" <othacehe@gnu.org>,
"Simon Tournier" <zimon.toutoune@gmail.com>,
"Tobias Geerinckx-Rice" <me@tobias.gr>
Subject: [bug#73434] [PATCH] lint: Check for minimal variants.
Date: Mon, 23 Sep 2024 10:56:01 +0300 [thread overview]
Message-ID: <da7d3f3459bcf8ba0963f2c1aba5eeb777926e1c.1727078144.git.efraim@flashner.co.il> (raw)
* 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 <h.goebel@crazy-compilers.com>
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
;;; Copyright © 2017, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2018, 2020, 2024 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2020 Timothy Sample <samplet@ngyro.com>
@@ -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 <efraim@flashner.co.il> רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
next reply other threads:[~2024-09-23 8:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 7:56 Efraim Flashner [this message]
2024-09-23 14:09 ` [bug#73434] [PATCH] lint: Check for minimal variants Suhail Singh
2024-09-24 7:16 ` Efraim Flashner
[not found] ` <handler.73434.B.172707834516907.ack@debbugs.gnu.org>
2024-09-29 16:11 ` bug#73434: Acknowledgement ([PATCH] lint: Check for minimal variants.) Efraim Flashner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=da7d3f3459bcf8ba0963f2c1aba5eeb777926e1c.1727078144.git.efraim@flashner.co.il \
--to=efraim@flashner.co.il \
--cc=73434@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
--cc=guix@cbaines.net \
--cc=ludo@gnu.org \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.