From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id yDqZCax1VWRvUgEASxT56A (envelope-from ) for ; Fri, 05 May 2023 23:31:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SFueCax1VWT0nQAAauVa8A (envelope-from ) for ; Fri, 05 May 2023 23:31:24 +0200 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 CCA5A29BA9 for ; Fri, 5 May 2023 23:31:23 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pv319-00018r-05; Fri, 05 May 2023 17:31:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pv316-00016u-MW for guix-patches@gnu.org; Fri, 05 May 2023 17:31:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pv316-0006Xl-AL for guix-patches@gnu.org; Fri, 05 May 2023 17:31:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pv314-0000EH-5r; Fri, 05 May 2023 17:31:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63320] [PATCH 0/2] Rewrite 'arguments' to gexps with 'guix style -S arguments' Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: julien@lepiller.eu, guix-patches@gnu.org Resent-Date: Fri, 05 May 2023 21:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63320 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63320@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Julien Lepiller X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Julien Lepiller Received: via spool by submit@debbugs.gnu.org id=B.1683322250857 (code B ref -1); Fri, 05 May 2023 21:31:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 May 2023 21:30:50 +0000 Received: from localhost ([127.0.0.1]:57667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pv30r-0000Dk-Ks for submit@debbugs.gnu.org; Fri, 05 May 2023 17:30:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:50950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pv30m-0000DU-FS for submit@debbugs.gnu.org; Fri, 05 May 2023 17:30:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pv30k-0000qH-BA for guix-patches@gnu.org; Fri, 05 May 2023 17:30:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pv30i-0006At-I5; Fri, 05 May 2023 17:30:41 -0400 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=tWcNMre0NgGbwW23xkvMp3uQRUcrb4qmZ0V7ZWqgyUI=; b=LgqjxXyEljEAEf SxfcjfZ9lRWLV21kIIBVo0kQYfQB+RpV1f5HIlb2tw/YMW8XPI1j29rI/VQOoORmxJESukoOcrlLa gqDE848hU6PyCsnna6pJ9pLe3zo9bXv4wShQxxojgIlxnbLV658ATzdjlUtyU3Dneg8bbqvtukrT0 Tzg2ZbQYC/ASqySOLfeD4ghmYAe6jV0wL7SE0dx1AUFzOLyAH+TZxx78EUXmtBpa6qG7z8VaRRGMc NHpqzWn4HcJzKKMmi9UCN2rPNGhT4QkVFIxAq7JbDSjgmpq1rwe2xVloHR36/qgoHDOOkAI+k4agf lCmkuSFKMHik/PPJGbww==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pv30i-0003xr-3g; Fri, 05 May 2023 17:30:40 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 5 May 2023 23:30:19 +0200 Message-Id: X-Mailer: git-send-email 2.39.2 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683322284; a=rsa-sha256; cv=none; b=BODueYXd4xP15vFz4hSn6+qAfDZHJKrkxrQKjsMRnQsO/xrJkRXu9bc1tA3NH+e8sMIKIe AEpqHt3Ncn4+tPVWed2x/cjx9LXrks789xeL2xalORmvi5Qp6CXmoPuP61JrZc7WKckrR6 K0ab/cK0HU1PGbM6g+M5CPg8sW04diQ8XwPX+H3bvn1dVtf2bl92SHOZmCbuoOMLaqACVI UGL6GIuGIfEmxD1QwMUKtWdQAH6LI489b7AVSMjPb0RQlu1F2VMxuUa8xQnYh7GZgw+w2m Q7bL52+T2R4sDy994hFE5FOzblRKhusiTDUpTciTJbyR68h5EV1G/ItLBjxJ0w== 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=LgqjxXyE; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683322284; 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=tWcNMre0NgGbwW23xkvMp3uQRUcrb4qmZ0V7ZWqgyUI=; b=S4/SRmNSURCSF76RJ7kWpM2+RXMi1CSt0O/wyCsbZZuZxfdx/kH902ZhuTWSFcsPz+tuQS xkX39UB2gIsizmydd2UyRKScFNeChzAK+bu4TEqRdx5sS8uo2uW3CsBq/KGh092FuTH9A/ NGKgun33zl0o9Ow6aCm0f4cxjkdRTxg7G3gxWXZC08W9kF8zSlVScH17U0eO71JxE+of9p 1JG8ubWVlHgWV+WaWa7VfnKCDAWb9ZBZ67tU15Al0T1WfX6dBH7lHpJvzGDxJE2wMPp2kH b90VAlN1WtX6j/0KGpP0y7PogY3583EeMX/xyFYaMl3WZheLmjK3TdFVRnq8oA== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=LgqjxXyE; 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.10 X-Spam-Score: -3.10 X-Migadu-Queue-Id: CCA5A29BA9 X-TUID: k7LlQCiKQW/8 Hello Guix! When preparing , 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: . 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