From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MJ/bBO/ONGFRHAEAgWs5BA (envelope-from ) for ; Sun, 05 Sep 2021 16:06:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id sASvAO/ONGEQZwAAB5/wlQ (envelope-from ) for ; Sun, 05 Sep 2021 14:06:39 +0000 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 B797723C2D for ; Sun, 5 Sep 2021 16:06:37 +0200 (CEST) Received: from localhost ([::1]:59376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMsn6-0001yA-OD for larch@yhetil.org; Sun, 05 Sep 2021 10:06:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMsmY-0001uJ-V9 for guix-patches@gnu.org; Sun, 05 Sep 2021 10:06:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39216) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMsmY-0002HI-Nj for guix-patches@gnu.org; Sun, 05 Sep 2021 10:06:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mMsmY-0002MJ-CA for guix-patches@gnu.org; Sun, 05 Sep 2021 10:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50401] [PATCH] scripts: import: Increase column width for pretty-printer. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 05 Sep 2021 14:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50401 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50401@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16308507509046 (code B ref -1); Sun, 05 Sep 2021 14:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Sep 2021 14:05:50 +0000 Received: from localhost ([127.0.0.1]:50762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMsmI-0002Lm-Gw for submit@debbugs.gnu.org; Sun, 05 Sep 2021 10:05:50 -0400 Received: from lists.gnu.org ([209.51.188.17]:33914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMsmG-0002Lf-Ix for submit@debbugs.gnu.org; Sun, 05 Sep 2021 10:05:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMsmG-0001XV-B5 for guix-patches@gnu.org; Sun, 05 Sep 2021 10:05:44 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:58618 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMsmD-00021r-I2 for guix-patches@gnu.org; Sun, 05 Sep 2021 10:05:43 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1630850737; bh=agj9Tau6qkElWA923gRN+UjupO0zTBcsXY+QPlqNs3Y=; h=From:To:Subject:Date; b=OhnVLfKMgqRX2oez8VmnvpWpcf1wKtqGUxgqaxuALtbHDmadhTP3hOz9sdKzdZJ/j wQREiIyRCpE4jy9UXk+6CukDziJlJUNW4ZZQ9v/VSoRMFNsstklm28Vhw4AV/EeBep /+LQ6xurMnbkYlqN3O+t1xuoNckPAmAxxDjDI/Lg= Message-Id: <3418edcdafdf9b6551759f4a392d8d3466f255c4.1630850420.git.public@yoctocell.xyz> Date: Sun, 05 Sep 2021 16:05:36 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 30 X-Spam_score: 3.0 X-Spam_bar: +++ X-Spam_report: (3.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.5, FROM_SUSPICIOUS_NTLD_FP=1.599, PDS_OTHER_BAD_TLD=1.999, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630850798; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=72hRLZQAsGDNfVMoWnMd4qwC5JfqELqTmBt/LhtlVnM=; b=BNUqlfC5QAJQcLClyTxzALQwBNnNSQro+FmUGc3R3VfH+OGsQ0njqQd0QL7Q6DhpC7XgbX r3CUCSqGnpDeXCeUo91vlFbFhftgJCTaxporR6PWDkMH+9AcocumQEMUc+h4jG9DVOya/3 gRMBk4zpwjY1Qh52qpAOzLwfznq2Hr+vPpTFDN/QDxyjmTJswMkon8NVcbCVJkBcC2WngJ mlZqxxtmcbQetGYrZQnOqjWozCfTL4ctvR7wG1+ML5VJX7KZTuTwBdhrp3UElGObIfGDC+ kMCRI5SDxEjgYCpndlbr1kr+oi5+L4i0kOKeY2hglKPr+j83OaHtd+ahLGq3Cw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630850798; a=rsa-sha256; cv=none; b=GXX4YYTaS50yhVPyuRypSnTpTIe6eY5Cc2KNO5GrblNyLs/R6BsDdbJ2PuzWbqx6U0oQuK AMQ7EA75i+4upqZ6tDq2xa8Xrrc7pfWr0SYJVV0CB8A3WBRi16bcw9OQ/yEaSDYThaM/1K FzjIS29gKxH0ljs8FTfAbHb1dA8QNsuCHE1HDCmBYUD1MvYjGUQstklmYHjpb9y1CZR4pY p1MYgchxl3ZSLLqFu6KfXDX9ew5DHYbOav9XEZIbqFcPasA1P7dPG8THYQPKJOwGdSkYK0 UxqXOsJwpvYU6kBxCbWpcXWlnI4k3WQ+QXONbEUZcn5iB/8Pwyj4Wh07ajDTeg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=OhnVLfKM; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=OhnVLfKM; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: B797723C2D X-Spam-Score: -0.31 X-Migadu-Scanner: scn1.migadu.com X-TUID: Im/xmCEi+UFN Previously, the max column width for the pretty-printer was 50, which caused generated package definitions to include unnecessary newlines, e.g., (home-page "https://gitlab.com/ttyperacer/terminal-typeracer") instead of (home-page "https://gitlab.com/ttyperacer/terminal-typeracer") * guix/scripts/import.scm (guix-import): Set max expression width to 80 when pretty-printing. --- I don=E2=80=99t know if there is an official stance on the column width, bu= t I most people seem to go with 80. Before, a generated package definition might look like this --8<---------------cut here---------------start------------->8--- (define-public rust-typeracer-2 (package (name "rust-typeracer") (version "2.0.7") (source (origin (method url-fetch) (uri (crate-uri "typeracer" version)) (file-name ; unnecessary newline here (string-append name "-" version ".tar.gz")) (sha256 (base32 "1q1f6aslmqab8kqds6azsz7li0r5z7alqar17r1d675vsqfiidml")))) (build-system cargo-build-system) (arguments `(#:cargo-inputs (("rust-clap" ,rust-clap-2) ("rust-directories-next" ,rust-directories-next-2) ("rust-git2" ,rust-git2-0.13) ("rust-itertools" ,rust-itertools-0.10) ("rust-rand" ,rust-rand-0.8) ("rust-refinery" ,rust-refinery-0.5) ("rust-rusqlite" ,rust-rusqlite-0.24) ("rust-serde" ,rust-serde-1) ("rust-termion" ,rust-termion-1) ("rust-toml" ,rust-toml-0.5) ("rust-tui" ,rust-tui-0.9) ("rust-unicode-segmentation" ,rust-unicode-segmentation-1) ("rust-unicode-width" ,rust-unicode-width-0.1)))) (home-page ; and here "https://gitlab.com/ttyperacer/terminal-typeracer") (synopsis "A terminal typing game. Race to see the fastest time you can get!") (description "This package provides a terminal typing game. Race to see the faste= st time you can get!") (license license:gpl3))) --8<---------------cut here---------------end--------------->8--- With the patch applied --8<---------------cut here---------------start------------->8--- (define-public rust-typeracer-2 (package (name "rust-typeracer") (version "2.0.7") (source (origin (method url-fetch) (uri (crate-uri "typeracer" version)) ;; No newline this time. (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 "1q1f6aslmqab8kqds6azsz7li0r5z7alqar17r1d675vsqfiidml")))) (build-system cargo-build-system) (arguments `(#:cargo-inputs (("rust-clap" ,rust-clap-2) ("rust-directories-next" ,rust-directories-next-2) ("rust-git2" ,rust-git2-0.13) ("rust-itertools" ,rust-itertools-0.10) ("rust-rand" ,rust-rand-0.8) ("rust-refinery" ,rust-refinery-0.5) ("rust-rusqlite" ,rust-rusqlite-0.24) ("rust-serde" ,rust-serde-1) ("rust-termion" ,rust-termion-1) ("rust-toml" ,rust-toml-0.5) ("rust-tui" ,rust-tui-0.9) ("rust-unicode-segmentation" ,rust-unicode-segmentation-1) ("rust-unicode-width" ,rust-unicode-width-0.1)))) ;; Here too! (home-page "https://gitlab.com/ttyperacer/terminal-typeracer") (synopsis "A terminal typing game. Race to see the fastest time you can get!") (description "This package provides a terminal typing game. Race to see the faste= st time you can get!") (license license:gpl3))) --8<---------------cut here---------------end--------------->8--- guix/scripts/import.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index b369a362d0..73508bade2 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -3,6 +3,7 @@ ;;; Copyright =C2=A9 2014 David Thompson ;;; Copyright =C2=A9 2018 Kyle Meyer ;;; Copyright =C2=A9 2019 Ricardo Wurmus +;;; Copyright =C2=A9 2021 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -117,7 +118,8 @@ Run IMPORTER with ARGS.\n")) (if (member importer importers) (let ((print (lambda (expr) (pretty-print expr (newline-rewriting-port - (current-output-port)))))) + (current-output-port)) + #:max-expr-width 80)))) (match (apply (resolve-importer importer) args) ((and expr (or ('package _ ...) ('let _ ...) base-commit: 9540323458de87b0b8aa421e449a4fe27af7c393 --=20 2.33.0