From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gN3aNdDV0mFnygAAgWs5BA (envelope-from ) for ; Mon, 03 Jan 2022 11:54:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YEUiM9DV0mFTXAEA9RJhRA (envelope-from ) for ; Mon, 03 Jan 2022 11:54:08 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8D4E934DFD for ; Mon, 3 Jan 2022 11:54:08 +0100 (CET) Received: from localhost ([::1]:57986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4Kyd-0000vM-Jr for larch@yhetil.org; Mon, 03 Jan 2022 05:54:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4KyY-0000t8-UM for guix-patches@gnu.org; Mon, 03 Jan 2022 05:54:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4KyY-0006Ue-F9 for guix-patches@gnu.org; Mon, 03 Jan 2022 05:54:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n4KyY-00053a-Eh for guix-patches@gnu.org; Mon, 03 Jan 2022 05:54:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52974] [PATCH 0/5] Formatting package definitions with 'guix style' Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 03 Jan 2022 10:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52974 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52974@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164120722819414 (code B ref -1); Mon, 03 Jan 2022 10:54:02 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641207248; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ODPArAidSDdwDVzj8GYLYtw2E3RQxtbkUg3KQ+bkc8g=; b=tmmm2V3dNtZWOfvr+ftyVuTXAgUHy9IvP9U1tAdAK4skTkxX6kvSoiFB6BlRHukg0sZkyM 9EA1Tx1Pnwhip2LjCacBMw2AC95kkObmVKBpHrE18wTZMr+hMXImI9ywjlGxqsrP9Ik3JG IYE6LWAnl/GAn9VBGkDKVjDsf3tcqaFoVQK0ayUq7nS0x7X9ILhwmreIrFi/q1iDoI6lG4 UOHsADFvcfoodJtks2+eE2n1Ej3FRtxydtK3l5kXtu54PooLbgQm9ALnd8NkxCXWPg0502 sIpUL+e/emsSe7VnXAqL0XRCUrK+I6xgIsQi5xRJwUvx6D7BypQKMfd4LBuLpg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641207248; a=rsa-sha256; cv=none; b=TepV1Vj/ENoWMknr07UcPKHgN5dT6O/0BZmxKr71nv0+XaUmEjw5dxMzZGiXujHFb6aZxs EGS5U/R6qCGZP/YvB2WTLupna7eUbBN8I0CJHi9aTE0Z1WEhwx8kgBAbEe5kgsAi3kRprt jq3qtc6/kSf4iAOU0lrTAqqmsqj5fQJV1y52eH42OKIyVqGRdzVDdJwjxU7Dd+KbZsNEX+ RC5KtGEoJGfGza6zXBWzSPtHjjEmbSH20KKpWXKxoCgNrSdmQfe8HK5bX/cloDoDNFDP4o 3mC8jhkHWQxr3jPE7C3PTBy/T29zFAujuxMuTWmSC9531HuKnkl6BtQ+WslGLQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Z9WkWh07; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.79 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Z9WkWh07; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 8D4E934DFD X-Spam-Score: -3.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: SPqopp8TJx5s 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