unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 56898@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#56898] [PATCH 00/13] Put the pretty printer to good use
Date: Tue,  2 Aug 2022 23:42:36 +0200	[thread overview]
Message-ID: <20220802214236.18965-1-ludo@gnu.org> (raw)

Hello Guix!

I shaved a yak!  This patch series promotes the pretty reader/printer
of ‘guix style’ to its own module, improves it so it can deal with
vertical space, adds a ‘-f’ option to ‘guix style’ to reformat
whole files, changes the installer to use this pretty-printer, and
changes the installer so it emits comments and vertical space in
the generated configuration.

You can use ‘guix style -f’ on any Scheme file.  The pretty-printer
does a decent job, though there are still cases where it’s not as
good as my little hands at formatting things nicely.  For newcomers,
it should be very helpful.

Comments?  Vertical space?  Page breaks?

Ludo’.

Ludovic Courtès (13):
  style: Move reader and printer to (guix read-print).
  read-print: Add System and Home special forms.
  read-print: Expose comment constructor.
  read-print: Introduce <blank> parent class of <comment>.
  style: Adjust test to not emit blank lines.
  read-print: Read and render vertical space.
  read-print: Recognize page breaks.
  read-print: Add code to read and write sequences of
    expressions/blanks.
  read-print: 'canonicalize-comment' leaves top-level comments
    unchanged.
  style: Add '--whole-file' option.
  read-print: Support printing multi-line comments.
  installer: Render the final configuration with (guix read-print).
  installer: Add comments and vertical space to the generated config.

 Makefile.am                |   3 +
 doc/guix.texi              |  28 +-
 gnu/installer.scm          |   3 +-
 gnu/installer/parted.scm   |  10 +-
 gnu/installer/services.scm |  39 ++-
 gnu/installer/steps.scm    |  32 +-
 gnu/installer/user.scm     |   7 +-
 guix/read-print.scm        | 678 +++++++++++++++++++++++++++++++++++++
 guix/scripts/import.scm    |   4 +-
 guix/scripts/style.scm     | 527 +++-------------------------
 tests/guix-style.sh        |  80 +++++
 tests/read-print.scm       | 358 ++++++++++++++++++++
 tests/style.scm            | 185 +---------
 13 files changed, 1270 insertions(+), 684 deletions(-)
 create mode 100644 guix/read-print.scm
 create mode 100644 tests/guix-style.sh
 create mode 100644 tests/read-print.scm


base-commit: d7e7494bc4d69de9db49488ee812e572c3250211
-- 
2.37.1





             reply	other threads:[~2022-08-02 21:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 21:42 Ludovic Courtès [this message]
2022-08-02 21:44 ` [bug#56898] [PATCH 01/13] style: Move reader and printer to (guix read-print) Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 02/13] read-print: Add System and Home special forms Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 03/13] read-print: Expose comment constructor Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 04/13] read-print: Introduce <blank> parent class of <comment> Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 05/13] style: Adjust test to not emit blank lines Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 06/13] read-print: Read and render vertical space Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 07/13] read-print: Recognize page breaks Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 08/13] read-print: Add code to read and write sequences of expressions/blanks Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 09/13] read-print: 'canonicalize-comment' leaves top-level comments unchanged Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 10/13] style: Add '--whole-file' option Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 11/13] read-print: Support printing multi-line comments Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 12/13] installer: Render the final configuration with (guix read-print) Ludovic Courtès
2022-08-02 21:44   ` [bug#56898] [PATCH 13/13] installer: Add comments and vertical space to the generated config Ludovic Courtès
2022-08-07 10:50 ` [bug#56898] [PATCH 00/13] Put the pretty printer to good use Mathieu Othacehe
2022-08-07 20:18   ` Ludovic Courtès
2022-08-09  9:42 ` bug#56898: " 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

  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=20220802214236.18965-1-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=56898@debbugs.gnu.org \
    /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).