unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Herman Rimm via Guix-patches via <guix-patches@gnu.org>
To: 74979@debbugs.gnu.org
Cc: "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#74979] [PATCH 4/4] scripts: style: Warn about unmatched package definitions.
Date: Thu, 19 Dec 2024 20:33:07 +0100	[thread overview]
Message-ID: <6986ddba422272423a928f2d0b40cd8aeb8752ea.1734636205.git.herman@rimm.ee> (raw)
In-Reply-To: <cover.1734636205.git.herman@rimm.ee>

* guix/scripts/style.scm (order-packages): Warn.

Change-Id: Iddbf979ee9ee5ed1ebada63776a390db024154fa
---
 guix/scripts/style.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm
index 4801529f7e..81fe1141e2 100644
--- a/guix/scripts/style.scm
+++ b/guix/scripts/style.scm
@@ -508,9 +508,15 @@ (define (order-packages lst)
          (((or 'package 'package/inherit) fields ...)
           (let ((name (and=> (assoc-ref fields 'name) first))
                 (version (and=> (assoc-ref fields 'version) first)))
+            (if (and name version)
+                (unless (and (string? name) (string? version))
+                  (warning (G_ "non-string name/version for ~a~%") pkg))
+                (warning (G_ "package fields not found for ~a~%") pkg))
             (values name version)))
-         (_ (and (values #f #f)))))
-      (_ (and (values #f #f)))))
+         (_ (and (warning (G_ "package record missing for ~a~%") pkg)
+                 (values #f #f)))))
+      (_ (and (info (G_ "not sorting top-level S-exp.: ~a~%") pkg)
+              (values #f #f)))))
 
   (define (package>? lst1 lst2)
     (let-values (((name1 version1) (package-fields lst1))
-- 
2.45.2





      parent reply	other threads:[~2024-12-19 19:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19 19:31 [bug#74979] [PATCH 0/4] scripts: style: Sort more kinds of package Herman Rimm via Guix-patches via
2024-12-19 19:33 ` [bug#74979] [PATCH 1/4] scripts: style: Refactor order-packages Herman Rimm via Guix-patches via
2024-12-19 19:33 ` [bug#74979] [PATCH 2/4] scripts: style: Sort more kinds of package definitions Herman Rimm via Guix-patches via
2024-12-19 19:33 ` [bug#74979] [PATCH 3/4] scripts: style: Only sort packages with string literal name Herman Rimm via Guix-patches via
2024-12-19 19:33 ` Herman Rimm via Guix-patches via [this message]

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6986ddba422272423a928f2d0b40cd8aeb8752ea.1734636205.git.herman@rimm.ee \
    --to=guix-patches@gnu.org \
    --cc=74979@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=guix@cbaines.net \
    --cc=herman@rimm.ee \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).