From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 03 05:53:48 2022 Received: (at submit) by debbugs.gnu.org; 3 Jan 2022 10:53:48 +0000 Received: from localhost ([127.0.0.1]:34229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4KyK-000534-Dj for submit@debbugs.gnu.org; Mon, 03 Jan 2022 05:53:48 -0500 Received: from lists.gnu.org ([209.51.188.17]:59114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4KyH-00052w-N3 for submit@debbugs.gnu.org; Mon, 03 Jan 2022 05:53:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4KyH-0000Xq-Fo for guix-patches@gnu.org; Mon, 03 Jan 2022 05:53:45 -0500 Received: from [2001:470:142:3::e] (port=48874 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4KyH-0006TK-7Q; Mon, 03 Jan 2022 05:53:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=ODPArAidSDdwDVzj8GYLYtw2E3RQxtbkUg3KQ+bkc8g=; b=Z9WkWh076Tmlft xUm14nVneEXN0dkJ0QRW4iLXhsqlQiti5mFhMQrYqfZkXToZ2tEHrpbUSIlY8vQpB1t8v9uklx2EG gMmjy1c6Y4N25I3mae3lFSpoRceGv0CSoJdf36YmAxnXQv6OZZbyM6eXOVlR9AoDkayHD7/4X9oRU jf9w58IKnh0/joha6DpaIuSbV85EpMFu8FNggjVgyn4tAQRPa6cGbkLPFE0OxQJyP3xkwNZAFUuqf tVQO3/NQfElpz//C9K/VO/NFRMGmJRKt/pr7N8jAARgUjRR2qOavfRlRXx86G+27NADpQv2pPzB1n qHuGDGp9QXyeyKSvg6+w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:54358 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4KyG-0000Wo-3t; Mon, 03 Jan 2022 05:53:45 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 0/5] Formatting package definitions with 'guix style' Date: Mon, 3 Jan 2022 11:53:35 +0100 Message-Id: <20220103105335.13164-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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