all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 63320@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>, "Julien Lepiller" <julien@lepiller.eu>
Subject: [bug#63320] [PATCH 0/2] Rewrite 'arguments' to gexps with 'guix style -S arguments'
Date: Fri,  5 May 2023 23:30:19 +0200	[thread overview]
Message-ID: <cover.1683321561.git.ludo@gnu.org> (raw)

Hello Guix!

When preparing <https://guix.gnu.org/en/blog/2021/the-big-change/>, I didn’t
consider converting ‘arguments’ from sexps to gexps a priority.  In practice,
we’ve been doing that manually ever since but there’s a sort of a “contamination”
aspect: due to inheritance, we often have to be careful enough to convert
multiple packages at once or to not change anything, or we end up with gexp
records inside sexps¹.  Automation appears to be overdue.

The attached patches add ‘guix style -S arguments’, which rewrites ‘arguments’
from sexps to gexps.  The change doesn’t involve any rebuild, so we could even
run it en masse on the whole repo and be done with it.

Some caveats:

  • The reader in (guix read-print) doesn’t support sexp comments (#;), which
    are used in a couple of packages.  Thus,

      ./pre-inst-env guix style -S arguments

    which traverses all the packages eventually chokes on it.

  • The pretty printer does not insert a newline after #:phases, which makes
    the space for (modify-phases …) expressions sometimes too narrow.  (This
    is not new; try ‘./pre-inst-env guix style PACKAGE’.)

  • More generally, the pretty printer’s output still has occasional glitches,
    sufficiently that running ‘guix style -S arguments’ on the whole repo may
    not be a good idea at the moment.

  • Some modules lack #:use-module (guix gexp), but this has to be added
    manually.

  • We might want an optional conservative policy to leave arguments that
    would not use gexps unchanged.  For instance, we could leave
    (arguments '(#:tests? #f)) unchanged instead of rewriting it to
    (arguments (list #:tests? #f)).

Thoughts?

Ludo’.

¹ This is what prompted Chris to improve error detection:
  <https://issues.guix.gnu.org/63263>.


Ludovic Courtès (2):
  style: Add 'arguments' styling rule.
  DRAFT news: Add entry to 'guix style -S arguments'.

 doc/guix.texi          |  51 ++++++++++++
 etc/news.scm           |  16 ++++
 guix/scripts/style.scm | 173 ++++++++++++++++++++++++++++++++++++++++-
 tests/style.scm        | 136 ++++++++++++++++++++++++++++++++
 4 files changed, 375 insertions(+), 1 deletion(-)


base-commit: 3c91f4ca490a7ac56dc0aebbca9c4bf4df201877
-- 
2.39.2





             reply	other threads:[~2023-05-05 21:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05 21:30 Ludovic Courtès [this message]
2023-05-05 21:40 ` [bug#63320] [PATCH 1/2] style: Add 'arguments' styling rule Ludovic Courtès
2023-05-05 21:40 ` [bug#63320] [PATCH 2/2] DRAFT news: Add entry to 'guix style -S arguments' Ludovic Courtès
2023-05-06 10:43   ` pelzflorian (Florian Pelz)
2023-05-18 18:10 ` bug#63320: [PATCH 0/2] Rewrite 'arguments' to gexps with " Ludovic Courtès

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=cover.1683321561.git.ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=63320@debbugs.gnu.org \
    --cc=julien@lepiller.eu \
    /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.