GNU bug report logs - #52974
[PATCH 0/5] Formatting package definitions with 'guix style'

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Mon, 3 Jan 2022 10:54:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Subject: bug#52974: closed (Re: bug#52974: [PATCH 0/5] Formatting package
 definitions with 'guix style')
Date: Mon, 10 Jan 2022 14:04:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#52974: [PATCH 0/5] Formatting package definitions with 'guix style'

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 52974 <at> debbugs.gnu.org.

-- 
52974: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52974
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: 52974-done <at> debbugs.gnu.org
Subject: Re: bug#52974: [PATCH 0/5] Formatting package definitions with
 'guix style'
Date: Mon, 10 Jan 2022 15:03:37 +0100
Ludovic Courtès <ludo <at> gnu.org> skribis:

> This patch set extends ‘guix style’ so that it can format
> package definitions following our conventions.  It adds a
> new ‘-S’ option to ‘guix style’, which allows you to select
> a “styling rule”.

Applied!

  0976e92a0f news: Add news entry about 'guix style'.
  5d9a5e2301 style: '-S format' canonicalizes comments.
  c4fe13c294 style: Add '--styling' option.
  6f892630ae style: Add support for "newline forms".
  208a7aa17b style: Allow special forms to be scoped.
  97d0055edb style: Improve pretty printer and add tests.

There wasn’t any formal comment during the review process, which is
unfortunate, but of course we can still tweak ‘guix style’ as we go.

Ludo’.

[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 0/5] Formatting package definitions with 'guix style'
Date: Mon,  3 Jan 2022 11:53:35 +0100
Hello Guix!

This patch set extends ‘guix style’ so that it can format
package definitions following our conventions.  It adds a
new ‘-S’ option to ‘guix style’, which allows you to select
a “styling rule”.

To obtain the same behavior as before, you now need to run
‘guix style -S inputs’ (this is an incompatibility); ‘guix
style’ alone is equivalent to ‘guix style -S format’, which
formats the given package definition(s).

The code of the pretty printer is not pretty, but it does a
rather good job, notably because it recognizes our special
forms and rules, unlike ‘pretty-print’.  I’m sure we could
spend months tweaking it, but I think it’s reached the point
where we can recommend it.

This nicely replaces ‘etc/indent-code.el’ and will hopefully
make the lives of contributors easier.

Thoughts?

Eventually we should change importers to use this instead of
(ice-9 pretty-print).  I also envision a rule to rewrite Rust
packages to look like regular packages, as discussed earlier
with Efraim, which will benefit from this work.

Ludo’.

Ludovic Courtès (5):
  style: Improve pretty printer and add tests.
  style: Allow special forms to be scoped.
  style: Add support for "newline forms".
  style: Add '--styling' option.
  style: '-S format' canonicalizes comments.

 doc/contributing.texi  |  18 +-
 doc/guix.texi          |  60 +++++-
 etc/indent-code.el     | 120 ------------
 guix/scripts/style.scm | 415 +++++++++++++++++++++++++++++++++++------
 tests/style.scm        | 162 +++++++++++++++-
 5 files changed, 571 insertions(+), 204 deletions(-)
 delete mode 100755 etc/indent-code.el


base-commit: 637dec9d45db4df2a3e6aa565fa2c5cf6bb77768
-- 
2.33.0




This bug report was last modified 3 years and 128 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.