X-Loop: help-debbugs@HIDDEN Subject: [bug#75151] [PATCH] import/utils: beautify-description: Validate argument Resent-From: Morgan Smith <Morgan.J.Smith@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Fri, 27 Dec 2024 22:22:02 +0000 Resent-Message-ID: <handler.75151.B.173533810612647 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 75151 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75151 <at> debbugs.gnu.org Cc: Morgan Smith <Morgan.J.Smith@HIDDEN> X-Debbugs-Original-To: guix-patches@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.173533810612647 (code B ref -1); Fri, 27 Dec 2024 22:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Dec 2024 22:21:46 +0000 Received: from localhost ([127.0.0.1]:47883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tRIiH-0003Hv-7P for submit <at> debbugs.gnu.org; Fri, 27 Dec 2024 17:21:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:59734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <Morgan.J.Smith@HIDDEN>) id 1tRIiE-0003Hj-LK for submit <at> debbugs.gnu.org; Fri, 27 Dec 2024 17:21:43 -0500 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 <Morgan.J.Smith@HIDDEN>) id 1tRIiE-0000S3-91 for guix-patches@HIDDEN; Fri, 27 Dec 2024 17:21:42 -0500 Received: from mail-dm6nam10olkn2032.outbound.protection.outlook.com ([40.92.41.32] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Morgan.J.Smith@HIDDEN>) id 1tRIiC-0001b0-6R for guix-patches@HIDDEN; Fri, 27 Dec 2024 17:21:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UiKtE5/p7cKZVpYQn4s8x4MpATJ8PoSdHV26Duy/m8lGpEJy5yr3F0bfOqgQ6qbNeCPYUHuKiLTvD+7IfoOp/Kyqp0Z0p8fZkUbugs/li1xoLDdOAIGb9m6EkHXroK7jMF+6D8vp/xLMgAIika12tpwi0xCZWwyyqxvyB9FyNLEadNtp+XKBkbb9MxI1yRvYBxKRD0lbQyRNFt/3/EGZcPlfZ8mjEA6PrAEC2ifNDXgulG6sIf1tMcnLjrViaxdmcOsBhdCAjiYQKjq64o9biUVf3B40zjGgtHlP4uFEvQg+IyToYivJiWAEYo4cqsWCKCNm2r6swZ9RQAHFUyL6+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nicY3ca3R92qUN1jbPcdKmXD0ZXhq/pTwlChXf8ikP8=; b=P7n3aQrH3KAaE3WAk73E+xk/UDQ0e7z2o91M0twEkKAnCuriVdeAFuZpSpslf+QKzsABgBCQRat1rg6WUYfDWWncvw9ku0IkUgkWbc6scfjgMboaYv3PhnDPr4nUtGVHL9NPBVqzlrFWe4peT41ywjrT46utuXKhmA9KOreC6M2kPIUmkeR0opEx7pdHrNGcUokPDzmX/RZu37a2xWZH8P18Q7fVhavL1i7zJ9nXBLyq9/HBjCxFiSZtT5DxCQCzUAfTkR1e8I4/F7tYFT/2Xn5+WMIMdlacY/kpODmOmOWyY8ke+c8Y3S98J4as/Y3PD/foHSAqxRqmcmieafCcTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nicY3ca3R92qUN1jbPcdKmXD0ZXhq/pTwlChXf8ikP8=; b=fjHWdLQh4mirJD/5rvWncVgBIRxqTP2SL5n+sf/BCT+SWr2hstsg5G2my2qFaAGNWcv5MaOJ+c0WM1Tygy9BvRlYmjw7VdxkBI5j+qRD+24sEeyNdZqhhIumxpAC6meUzMsAD7wsfLy2U/HcmvZqaBHmkXXIlgLG07d1ImbEmuzztQvpUIqB2FJA/UpDrrPejAp5UEodArbaRmRP3kCisZ81uYT0U8paQY2Kqa7CJ5rV0pI1yuSA/GDhy3Mq4+HF9lPYZ4cc6ENTCAK6BWQz5AfUHtC6FTygpX4kZmGWcGyfr+qWRWLkXYe7t1vEqC1v4fg3eJIdeUkXznQegKStIg== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by PH0PR84MB2025.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:160::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.14; Fri, 27 Dec 2024 22:21:36 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%4]) with mapi id 15.20.8293.000; Fri, 27 Dec 2024 22:21:36 +0000 From: Morgan Smith <Morgan.J.Smith@HIDDEN> Date: Fri, 27 Dec 2024 17:18:38 -0500 Message-ID: <CH3PR84MB3424E6AE9729DF52B792B1D5C50E2@HIDDEN> X-Mailer: git-send-email 2.47.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT4PR01CA0411.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10b::28) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <75e7d7862811d04bc08e32e92804d370173100d0.1735337917.git.Morgan.J.Smith@HIDDEN> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|PH0PR84MB2025:EE_ X-MS-Office365-Filtering-Correlation-Id: d6804579-53ab-4d2f-039b-08dd26c4d3b4 X-Microsoft-Antispam: BCL:0; ARA:14566002|7092599003|8060799006|19110799003|461199028|5072599009|15080799006|3412199025|440099028|1710799026; X-Microsoft-Antispam-Message-Info: tMo+bC/IgxCIWLdezVGOa6Qa9QpMSULTZt8dMFZisyYurg8Pp7P5K4J2nPgXadukt2zEJE1j0QFwqhx0NnmRgj7MBLRj+iBkUScBxkJpe1VjbpytvoC7qjni96pRn/jOAAyCGJf7Sojv/tnl+mAIlEMvB/2xvcJvir4iC+/Vygxx+U36qvj0Ko5fUpsuob6bROT/+0WKa11NacDIUAU94Puoju7IO6Yaaut93m1kmCVCQ70qHnJbM+noMYvs7vuI9YOVoJYGXjqOkjXiHO6hVC1CfR8puBnwSqextAuy/VP4j+hmdTkJ6Yn+kgXHxHCYYX7tXLt25iAgh+AH0LO4vmB5blmV8v7v1n9QNjaZGyH7ImthdtfuW0I8SntWy4A53pJiZJxqERzkZUDlk3Z3HZ+JSNdpluPDltzrHNYOP4uDeL5M7SADxNgxAt4FgH25/Fie1EJ5HU3/xwp6BH4RGbCeBlVkWP3NoEsGORKBxVuv8NiW2Y8fDi29du2anFGZ16xDiHdgfUP7Gyw9JJoU7dk0WaXwTif9/leT0joQ9zKTnYKWDZpZEWPG9qbE5losZ9oy7I7YSkfk549Ba2cRc/gRo2wAtBff/59kdXhZjl58uu/iK9GtLhYQTPIRC29Q6AVg913zqXwp3sywKg3E8+HcMqDQKHvSmUhR8Y+sgZpHQDHdYDPxYlaxqDc0hxBL3PAG3lqq+QxXk4rvbpQdahOEK7f3+JwWtgK9e7SmTcYnOqydt0FO7DQ/yrbfsd7jAzMhA3rgkPVb7QKmugCMVCtkDe0dsFPdyohL1MwTvw06maIPPxbwiiiB3BjVpAjDLk4CGZHL560dp4kV6FzF0gAvX9DGA6MqSY2lTeaH5IHMsJvIbzj9wM+yo3cy2W5pJymPADA0m/NP0mOQYRpGUEoreYDjbpf6TVSDT2wvNfGc1mQWtShmqQVgG+EUYVRBNH8sqyutmQTgfMiimCay+P1LpFo+NpUYQ8f8AbzB0ddLzWiuWAow8ppTAU8DJsFFGwpnui7wO9MrC7CAW8IK1I+Q3kVYpAhbts2LyFRp2TBTTc7V0sPqqnmDBgdBVc4XCb07ibZuaq6sQ9ohynFTn2o7zhlRBLvpgDMxD+nsd80= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i5wS+yY8TGUUw7Ne/YZzCJORkT0BNOYY2FveAzBQsLQtxHn2a4trSqCLqsPUy357v+UKA1GBlE3edmKxRc5JNqKdtuo5AKEdZTqouPZLrHdZwNIWBK3REVNiP3R5LGMIwvQpeWOSHcbDSKgql/igEKVmBVzy9PiSlHQI2b3tW5WI4MReNDba8l7t3e/iEG4rFIjMLGqr7A1jKddB3pJqnrXdfcQarh9l4EIr68sxX+tg2DGytI+40DaMK6aQ+UVlqdcKoX7kkcOK+QyNZe20YiLDtGYWLLWU+L3voJ9X42wYiJvuuMNMPY8xGMGYenPOXBogfPqMneA6KN0xNAqXIJWEXhcXOGDSNVweoOK8fwYqtn4QKVKr1+09n0ttsntrDzPM9yfsE6YJUYhCQY1PIRYFR0Fb/62b19C08BvT0K+GXC0aMK9+7Osg2eqkwo8EihKnTL4bxkXGnPVBrkuZJ0WYlVZBtCFjAnJJEo5YG37+Gg9gCNwReN1T0RjCgmBGg3y3U3OqOMTZ0vMSlR6y95/1kS2msOL35NTtDGBKqXYe5wRO6g0zCndzYbFtnO2LnU3Y/WE5XJp36QbIM2iTQotPpMgVYl+exRPO8mWnKI7+7ibDvAojCoKFutAxReeMgy8Onz1yqT1P4LxiiJWosm4/F5LHmS7ZTUda1KWJnJB5NmVZ3d9HWtabhJ0N2Uwvm80BWzJ3VipC8qCJYyREZa1PPAqQjXrnMA5t6aFV5jY5A40r83h3zT/Og4G6Sntt+/FF/27jaAK/1hTvPUEIzzK0krFb9Ls+3hTUd2AaMdrOd5sCz+qEsSbvVqqXRSIWxD8TpunabuU7KxXpT2glfwWCHPb7Airs9sutii9dXoajAThN83a50CdPs6WcEZ5Mh6j65H7rPznjTZSMR5rzyZMEN7yg+AqOWmv4s78xOO6KImmM7AB4erWzm0/aTDdcMSo4Y41GU3gWvpnoagNXWA8fAOj6lz6A2Hm5XbGR8vcZM/Qfo2cR4uOWw02JD/KSRnU3o6wIqR4dKA4XOd49JminESTw8z0+oYwemhNatm7vMEJxk/GYFOdNVRzP7omlPFqgvZnGdtmvM4DpThidE64dxMDteahhWBxJYz5hxou+2ceaxLaaqlew4vTrl/fXt+ek2qDLAGjuogOHwCQEvyibYoA2QK/HWH0/mWTBLf3M3Ign5gwl0t0Dl/UCeZ9Mr6POtqBE7rFUGw95yD/87K9bLyn9owJz0gELZIlLY8O/C+34EjsIgEe9cuM3EbsP X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6804579-53ab-4d2f-039b-08dd26c4d3b4 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2024 22:21:36.6320 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR84MB2025 Received-SPF: pass client-ip=40.92.41.32; envelope-from=Morgan.J.Smith@HIDDEN; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) * guix/import/utils.scm (beautify-description): Fix broken check for non-strings. Add a check for empty strings. * tests/import-utils.scm: Add two tests. Change-Id: Idf86df02aeb850fcc8808b7c9251082c1f816656 --- Hello! I was trying to run "guix import hackage orgstat" to no avail. It turns out it was because 'beautify-description' errors when given the empty string. It already had a check for arguments that where not a string but that check was actually broken. So I fixed the existing check and added a new one for an empty string. guix/import/utils.scm | 160 +++++++++++++++++++++-------------------- tests/import-utils.scm | 10 +++ 2 files changed, 91 insertions(+), 79 deletions(-) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index e45c8dfb20..bb268ebe4b 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -328,85 +328,87 @@ (define* (beautify-description description #:optional (length 80)) "Improve the package DESCRIPTION by turning a beginning sentence fragment into a proper sentence and by using two spaces between sentences, and wrap lines at LENGTH characters." - (unless (string? description) - (G_ "This package lacks a description. Run \ -\"info '(guix) Synopses and Descriptions'\" for more information.")) - - (let* ((fix-word - (lambda (word) - (fold (lambda (proc acc) (proc acc)) word - (list - ;; Remove wrapping in single quotes, common in R packages. - (cut string-trim-both <> #\') - ;; Escape single @ to prevent it from being understood as - ;; invalid Texinfo syntax. - (cut regexp-substitute/global #f "@" <> 'pre "@@" 'post) - ;; Wrap camelCase or PascalCase words or text followed - ;; immediately by "()" in @code{...}. - (lambda (word) - (let ((pattern - (make-regexp - "([A-Z][a-z]+[A-Z]|[a-z]+[A-Z]|.+\\(\\))"))) - (match (list-matches pattern word) - (() word) - ((m . rest) - ;; Do not include leading or trailing punctuation, - ;; unless its "()". - (let* ((last-text (if (string-suffix? "()" (match:substring m 1)) - (string-length (match:substring m 1)) - (or (and=> (string-skip-right word char-set:punctuation) 1+) - (string-length word)))) - (inner (substring word (match:start m) last-text)) - (pre (string-take word (match:start m))) - (post (substring word last-text (string-length word)))) - (string-append pre "@code{" inner "}" post)))))))))) - (words - (string-tokenize (string-trim-both description) - (char-set-complement - (char-set #\space #\newline)))) - (new-words - (match words - (((and (or "A" "Classes" "Functions" "Methods" "Tools") - first) . rest) - (cons* "This" "package" "provides" - (string-downcase first) rest)) - (((and (or "Contains" - "Creates" - "Performs" - "Provides" - "Produces" - "Implements" - "Infers") first) . rest) - (cons* "This" "package" - (string-downcase first) rest)) - (_ words))) - (new-words - (match new-words - ((rest ... last) - (reverse (cons (if (or (string-suffix? "." last) - (string-suffix? "!" last) - (string-suffix? "?" last)) - last - (string-append last ".")) - (reverse rest)))))) - (cleaned - (string-join (map fix-word new-words)))) - ;; Use double spacing between sentences - (fill-paragraph (regexp-substitute/global #f "\\. \\b" - cleaned 'pre - (lambda (m) - (let ((pre (match:prefix m)) - (abbrevs '("Dr" "Mr" "Mrs" - "Ms" "Prof" "vs" - "e.g"))) - (if (and (> (string-length pre) 0) - (or (any (cut string-suffix? <> pre) abbrevs) - (char-upper-case? - (string-ref pre (1- (string-length pre)))))) - ". " - ". "))) - 'post) - length))) + (if (or (not (string? description)) (string=? (string-trim-both description) "")) + (G_ "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information.") + + (let* ((fix-word + (lambda (word) + (fold (lambda (proc acc) (proc acc)) word + (list + ;; Remove wrapping in single quotes, common in R packages. + (cut string-trim-both <> #\') + ;; Escape single @ to prevent it from being understood as + ;; invalid Texinfo syntax. + (cut regexp-substitute/global #f "@" <> 'pre "@@" 'post) + ;; Wrap camelCase or PascalCase words or text followed + ;; immediately by "()" in @code{...}. + (lambda (word) + (let ((pattern + (make-regexp + "([A-Z][a-z]+[A-Z]|[a-z]+[A-Z]|.+\\(\\))"))) + (match (list-matches pattern word) + (() word) + ((m . rest) + ;; Do not include leading or trailing punctuation, + ;; unless its "()". + (let* ((last-text + (if (string-suffix? "()" (match:substring m 1)) + (string-length (match:substring m 1)) + (or (and=> (string-skip-right word char-set:punctuation) 1+) + (string-length word)))) + (inner (substring word (match:start m) last-text)) + (pre (string-take word (match:start m))) + (post (substring word last-text (string-length word)))) + (string-append pre "@code{" inner "}" post)))))))))) + (words + (string-tokenize (string-trim-both description) + (char-set-complement + (char-set #\space #\newline)))) + (new-words + (match words + (((and (or "A" "Classes" "Functions" "Methods" "Tools") + first) . rest) + (cons* "This" "package" "provides" + (string-downcase first) rest)) + (((and (or "Contains" + "Creates" + "Performs" + "Provides" + "Produces" + "Implements" + "Infers") first) . rest) + (cons* "This" "package" + (string-downcase first) rest)) + (_ words))) + (new-words + (match new-words + ((rest ... last) + (reverse (cons (if (or (string-suffix? "." last) + (string-suffix? "!" last) + (string-suffix? "?" last)) + last + (string-append last ".")) + (reverse rest)))))) + (cleaned + (string-join (map fix-word new-words)))) + ;; Use double spacing between sentences + (fill-paragraph + (regexp-substitute/global #f "\\. \\b" + cleaned 'pre + (lambda (m) + (let ((pre (match:prefix m)) + (abbrevs '("Dr" "Mr" "Mrs" + "Ms" "Prof" "vs" + "e.g"))) + (if (and (> (string-length pre) 0) + (or (any (cut string-suffix? <> pre) abbrevs) + (char-upper-case? + (string-ref pre (1- (string-length pre)))))) + ". " + ". "))) + 'post) + length)))) (define (beautify-synopsis synopsis) "Improve the package SYNOPSIS." diff --git a/tests/import-utils.scm b/tests/import-utils.scm index 607349203c..27bd87940a 100644 --- a/tests/import-utils.scm +++ b/tests/import-utils.scm @@ -31,6 +31,16 @@ (define-module (test-import-utils) (test-begin "import-utils") +(test-equal "beautify-description: empty string" + "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information." + (beautify-description "")) + +(test-equal "beautify-description: not a string" + "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information." + (beautify-description '())) + (test-equal "beautify-description: use double spacing" "\ Trust me Mr. Hendrix, M. Night Shyamalan et al. \ base-commit: 3a8c20408f0078a580d27f74bc69b5a1069a003b -- 2.47.1
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Morgan Smith <Morgan.J.Smith@HIDDEN> Subject: bug#75151: Acknowledgement ([PATCH] import/utils: beautify-description: Validate argument) Message-ID: <handler.75151.B.173533810612647.ack <at> debbugs.gnu.org> References: <CH3PR84MB3424E6AE9729DF52B792B1D5C50E2@HIDDEN> X-Gnu-PR-Message: ack 75151 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 75151 <at> debbugs.gnu.org Date: Fri, 27 Dec 2024 22:22:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): guix-patches@HIDDEN If you wish to submit further information on this problem, please send it to 75151 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 75151: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D75151 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: [bug#75151] [PATCH v2] import/utils: beautify-description: Validate argument References: <CH3PR84MB3424E6AE9729DF52B792B1D5C50E2@HIDDEN> In-Reply-To: <CH3PR84MB3424E6AE9729DF52B792B1D5C50E2@HIDDEN> Resent-From: Morgan Smith <Morgan.J.Smith@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Mon, 07 Apr 2025 20:55:03 +0000 Resent-Message-ID: <handler.75151.B75151.174405929829450 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 75151 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75151 <at> debbugs.gnu.org Cc: Morgan Smith <Morgan.J.Smith@HIDDEN> Received: via spool by 75151-submit <at> debbugs.gnu.org id=B75151.174405929829450 (code B ref 75151); Mon, 07 Apr 2025 20:55:03 +0000 Received: (at 75151) by debbugs.gnu.org; 7 Apr 2025 20:54:58 +0000 Received: from localhost ([127.0.0.1]:57190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1u1tUg-0007et-54 for submit <at> debbugs.gnu.org; Mon, 07 Apr 2025 16:54:58 -0400 Received: from mail-bn8nam04olkn20802.outbound.protection.outlook.com ([2a01:111:f403:2c08::802]:56064 helo=NAM04-BN8-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <Morgan.J.Smith@HIDDEN>) id 1u1tUd-0007eN-Qm for 75151 <at> debbugs.gnu.org; Mon, 07 Apr 2025 16:54:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hexmICKVLnDnkTjQcHdsqyh1ksZmcJgbrxfsXactYFN132MjzWOssK6Zzcu8ux/dLQDGZOW2unwJUHnO2buZMzSAjQDjwZ0k6sT4YZQzwhIYA9ih8g3OExzpADGzH5xn4HHslx/WwfhBF2tZkV68Gu4dNbRQ8jIbhph7FKxfeY3tcvKgLKEuVL+2ssZhRm5AC+MR4Eb+4fOI0y/LjEzGvyXyWrdzWqozWioATPyHbEMzS0T2QX3njt0URfr8YIghjjep25bBjiJFMIjcd9ip2v5IDX2k5W6Wp8h7tBBLtuEc8z25Crk7L+lnUqsFmxfib1qe67myZikPU3c5OqvdjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4aJjXrwDbZ4sp281FiPNezLNvyFQYdjuRIIxcFcYraY=; b=kLsRVLvHqwKAqxbZeKnx1XLQXRmPlLcReXCB8g9Ju2rl4Tg0hn3wz+2a2HrLvFj3l+EQVsfPF1TXOGrtOvgGcRQ5Lgx929P2IIvBFFihZnTVNNh29/wqfnQVAPNAP7jJXSt2r9s90pebgbs03Y36fI763JlzKmTg906ygCYrz2l3Z1RTOBKpuD57tcWJ9vdeaXYKCHNWYCsTUY7h1KRaQP+VsGMkQA+u0hHKMv9dP1zd3vjFYJ7ENvq/LOyL5bM06b0siUf7OwHkcQG9Uw/AdHSsHqXE6xeaeNBGNI7sDotwQ0KpWS43INvBdmYzoRESDeVILFdDBN23t5Y0IE/BQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4aJjXrwDbZ4sp281FiPNezLNvyFQYdjuRIIxcFcYraY=; b=KXXOxhHj9OYZaYxrvJwmKRdJZSfoZVhLuYXhamfFOT/f0SVhv+aPhRbcWyH5tzTrUluXvC34ioIrv0LeTuMW/dFjpACyK1eaTQcazDHww+GUrFk9gtWhJ5KVY1qqPSJHqk7ewHLRIUCosvXbGkhy/TS0Js3xE2ej0ZveqTf94PNpp8LhbVaX7Bye24KdR82uJNF/mvayxa5WsaeGJNceROA3qcGhqDxBa0Fu1wHh56oWBmiWxGXJexPwoev40daXt87hFSP7mTDCqZlxAuVRV3aNtwFWwRbvGETlQJwG6V/fnaGTtxRrH13ixC6u8dzRpCmhDwZFVPsrTVU9XRJm4g== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by LV3PR84MB3661.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:408:20f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.33; Mon, 7 Apr 2025 20:54:47 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%5]) with mapi id 15.20.8606.033; Mon, 7 Apr 2025 20:54:47 +0000 From: Morgan Smith <Morgan.J.Smith@HIDDEN> Date: Mon, 7 Apr 2025 16:53:52 -0400 Message-ID: <CH3PR84MB34244D12FFD3500FA35CB965C5AA2@HIDDEN> X-Mailer: git-send-email 2.49.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YQZPR01CA0157.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:8c::6) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <16801d320f4923afbbed6ccfd08802552fddc335.1744059231.git.Morgan.J.Smith@HIDDEN> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|LV3PR84MB3661:EE_ X-MS-Office365-Filtering-Correlation-Id: 77851a04-4296-4370-2a58-08dd76166e31 X-Microsoft-Antispam: BCL:0; ARA:14566002|7092599003|5072599009|8060799006|19110799003|15080799006|461199028|440099028|3412199025|41001999003|1710799026; X-Microsoft-Antispam-Message-Info: qvRcXT4LRFQ8Oox87bS/7HnCgatpYBXwssWHBKwO7j+mz/cIKwWjKP82/XNdyhOoYI/sMH+lVtdfXcr6jE9QG2cQguQdDtHU2UF67JsrkcRTrJH8VKaTKH97TRle8UVrKM1wkCYvVCO/rM8YfkPVGGn7O6y4KiVsaN+/xV56UJ8RyoP6XEYXEoSRuTuY+a0FmKXGsOIKmusHhC0nss9qj2BQmjFCbNJsvN3QnJOCwWVDISNbWhe/bSgypHeZYwMFR2jDTRPT+pg0hHdCv30GtmGy0iemDRpMutLWZmPk6dDm6GLKbZTycrhiPfDABjPUpUdO16m2K1pJL7ES5qEaScCFuLxyLdjckAnFvdecCxdq4JB2tfqbW1kfzNqNro3+AYqLGahUy/MRZtR7/eKsvGpdcktabSoXWuymII/pA9VUpLq9Roe6Dj8mePz9GsGuUCQ+nwNKG5IwC3IQ1F2ikPbNL5VQM7cBb+Z3AD+5GiI9+mj3dwpbF4XLXpgXOf/7zjrMZdL9kKnz/4GJI/pvbRxmmIaGYcAZhKhe1twXxgeQspQnhsKrORgkMTPN8LTpGufvb1vE2Tc/ah7vFUb6VyhZ6R0Sy0eceq6RMG+zUjVXmZU7jsPH3u4wCXuaYGU5+eetiBcaa5a7Ojmo8P34FrF7M8YbmNZfpR71oyFMHe5pyo4uLOwb5WfMwM01et+SpIEqmabJr3jh5zGkbmxNiz7f91Q3RriRTZX0YxfeHrNKxAEIzvPAsxF5aAz+mQJuS1Tf2EzNN1za/htu9jC6WppBFMGscOGAWfrD2Q1B8sdA8Az87bCArpp+uuFAc7m9vwOAIfq+fDBueBMU7bBauivY/f5vt3SKmis3EQcxUfIz9+PXKmtfQkywnvQdZ5TePvtHs+C9IKA9SuLCfxj86jFSzeykBaohQ+z2Cef/y+Af3Uj8eqTeys8UwkYt9l+mZsb6bWzRSMNCnuJhFho71qeEzO2QZuuIPOqrrLnVPAqQT09yKcIx/0/0HM8EfXf7+LJkVvgA7DTXSSmz9HXHbmZHri3Jux2/+rLS562iRC+gQndGeXqvsuOQMRp3zVFPKBWbQbOmGyn8HE/1RByUwTo9vjZpoLVdnZ3UjG9Ni+xhdRuvnsB6+F0sVsvFXE6GRz0EjfOfBtvhstmMMNLsyLxtyBuckmDSSgw5bW7aMT0= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vC6akXkjqvdRfB8fcL8eBqI2ArAFeYqaanVxjeTVt0oTSApKyl8Jlzf+L4OC6HRQ2C+9VvqDQcpMI2+FMhfRnBP7UTWQn36hj3NH9qcD8Ry+wrdF3pTKTg90v0XQS/+O62Kx5tgcuWqQsYrVaoniwVPXQtEWxLoLV8u7p0kAAtDAGPgem096NXRYrJYBFu+zuBG7Z8ck9IyNpq8vhNmfadIhW44q/TZ29ZoFSGLpvtj9cIgqUwzPK0erXgh5jI3tzmQ8BigaZxF1MCX4WscXw26A4XK+pa9KVVs04uRw9av26jtuXOCIaUb3sIpo87XbfpVK2mBs1onuozI8svBPd9lN83047FTsl3gXR6xj3/wS5Wm2iJmu/JQUfy05wlglbFDLxKQcjzraTqV1UiJhwTKOrUGPUS/Usi1pK0hsZKnCtfP3UciM3fxhxKvhEe1tX2maY97A3Xa4Rqn/la1PhtLs+mFs+v9zmZVDp+zLZXYdGwEAjt1/mA8CRAQBbDZA7WQRpgrGvhDMeOsv0XfN9xJ8pKEOdebJqRyszMZLaSDNZANnVAYfy9w583cH9xYqCoc8Q6AtcV6zbwMSLd1woM35lrmdS8p9vDtSKF/Vs42YKANHKWW0XNIjBjlCa8GxR6VPIJVYwxnW5pdZESvo68mJK/5+qrTrivqX8OgaEkWDhZDbSukGuri7lcHd2v6CxfxbAB86xtlnHwHI5FsDKymyRpDvFDYfZ0FoShoy5yKpEnsJghiA8ePzGuI/mcB6SSeiVWDzJvsU6w16OgQOy4LPp4RMVLGIhTK/MEq+cIFiOWzveG1YRyTSKBsGmEmQ87BbDAKI5gzOUOHUBB0JE1OgavuFmiKuav2yKlrGO62m03YX4BREon1CRDRuyFh53997pmwvrURPLl637j3eX7dw47tZmeq/x2OzgyTuZTDD5uILHyNCIOyGqoaqlLd4hwt/Ir7QpVryphkIildHBVvmPKpoxHoRCeP+K2nAJypRC1z8L0YaofE+t9Nnju24E/crQEiYfy4AyrFldBVasQMS/6ocPfRTM4EbeeKv72QCpEwJWrpHC7Krto69U0KEz5mhekvzkZBo6rxblMculd5pv4F1UlCMjiEk1oUYbfsX3wdsWLXp28MirW2mAJFXsm3DjN1x1JMZlAwsW6hDiW/i5N1UDWW8kRqqk9QoN1HddDEtRcHpfSkF6P8tdTx6lgbZQfsYrvs2zTnrqUP8udEruO92681b4N0UZAs1mvklMzCrOCb5iFzE44BUIlx8 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77851a04-4296-4370-2a58-08dd76166e31 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2025 20:54:47.0763 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR84MB3661 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/import/utils.scm (beautify-description): Fix broken check for non-strings. Add a check for empty strings. * tests/import-utils.scm: Add two tests. Change-Id: Idf86df02aeb850fcc8808b7c9251082c1f816656 --- Resending after rebasing this. guix/import/utils.scm | 8 ++++---- tests/import-utils.scm | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 38c986b4d5..0ef84c9cdf 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -331,9 +331,9 @@ (define* (beautify-description description #:optional (length 80)) "Improve the package DESCRIPTION by turning a beginning sentence fragment into a proper sentence and by using two spaces between sentences, and wrap lines at LENGTH characters." - (unless (string? description) - (G_ "This package lacks a description. Run \ -\"info '(guix) Synopses and Descriptions'\" for more information.")) + (if (or (not (string? description)) (string=? (string-trim-both description) "")) + (G_ "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information.") (let* ((fix-word (lambda (word) @@ -410,7 +410,7 @@ (define* (beautify-description description #:optional (length 80)) ". " ". "))) 'post) - length))) + length)))) (define (beautify-synopsis synopsis) "Improve the package SYNOPSIS." diff --git a/tests/import-utils.scm b/tests/import-utils.scm index 221866e871..273f18254e 100644 --- a/tests/import-utils.scm +++ b/tests/import-utils.scm @@ -31,6 +31,16 @@ (define-module (test-import-utils) (test-begin "import-utils") +(test-equal "beautify-description: empty string" + "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information." + (beautify-description "")) + +(test-equal "beautify-description: not a string" + "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information." + (beautify-description '())) + (test-equal "beautify-description: use double spacing" "\ Trust me Mr. Hendrix, M. Night Shyamalan et al. \ base-commit: 666a6cfd88b3e5106a9180e06ea128db8084be0e -- 2.49.0
MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Subject: bug#75151: closed ([PATCH] import/utils: beautify-description: Validate argument) CC: tracker <at> debbugs.gnu.org Message-ID: <handler.75151.D75151.174470548927716.ackdone <at> debbugs.gnu.org> References: <87h62pkf9m.fsf_-_@HIDDEN> <CH3PR84MB3424E6AE9729DF52B792B1D5C50E2@HIDDEN> X-Gnu-PR-Message: closed 75151 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Date: Tue, 15 Apr 2025 08:25:06 +0000 Content-Type: multipart/mixed; boundary="----------=_1744705506-27834-0" This is a multi-part message in MIME format... ------------=_1744705506-27834-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Tue, 15 Apr 2025 10:20:05 +0200 with message-id <87h62pkf9m.fsf_-_@HIDDEN> and subject line Re: bug#75151: [PATCH] import/utils: beautify-description:= Validate argument has caused the debbugs.gnu.org bug report #75151, regarding [PATCH] import/utils: beautify-description: Validate argument to be marked as done. (If you believe you have received this mail in error, please contact help-debbugs@HIDDEN) --=20 75151: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D75151 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems ------------=_1744705506-27834-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 27 Dec 2024 22:21:46 +0000 Received: from localhost ([127.0.0.1]:47883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tRIiH-0003Hv-7P for submit <at> debbugs.gnu.org; Fri, 27 Dec 2024 17:21:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:59734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <Morgan.J.Smith@HIDDEN>) id 1tRIiE-0003Hj-LK for submit <at> debbugs.gnu.org; Fri, 27 Dec 2024 17:21:43 -0500 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 <Morgan.J.Smith@HIDDEN>) id 1tRIiE-0000S3-91 for guix-patches@HIDDEN; Fri, 27 Dec 2024 17:21:42 -0500 Received: from mail-dm6nam10olkn2032.outbound.protection.outlook.com ([40.92.41.32] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Morgan.J.Smith@HIDDEN>) id 1tRIiC-0001b0-6R for guix-patches@HIDDEN; Fri, 27 Dec 2024 17:21:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UiKtE5/p7cKZVpYQn4s8x4MpATJ8PoSdHV26Duy/m8lGpEJy5yr3F0bfOqgQ6qbNeCPYUHuKiLTvD+7IfoOp/Kyqp0Z0p8fZkUbugs/li1xoLDdOAIGb9m6EkHXroK7jMF+6D8vp/xLMgAIika12tpwi0xCZWwyyqxvyB9FyNLEadNtp+XKBkbb9MxI1yRvYBxKRD0lbQyRNFt/3/EGZcPlfZ8mjEA6PrAEC2ifNDXgulG6sIf1tMcnLjrViaxdmcOsBhdCAjiYQKjq64o9biUVf3B40zjGgtHlP4uFEvQg+IyToYivJiWAEYo4cqsWCKCNm2r6swZ9RQAHFUyL6+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nicY3ca3R92qUN1jbPcdKmXD0ZXhq/pTwlChXf8ikP8=; b=P7n3aQrH3KAaE3WAk73E+xk/UDQ0e7z2o91M0twEkKAnCuriVdeAFuZpSpslf+QKzsABgBCQRat1rg6WUYfDWWncvw9ku0IkUgkWbc6scfjgMboaYv3PhnDPr4nUtGVHL9NPBVqzlrFWe4peT41ywjrT46utuXKhmA9KOreC6M2kPIUmkeR0opEx7pdHrNGcUokPDzmX/RZu37a2xWZH8P18Q7fVhavL1i7zJ9nXBLyq9/HBjCxFiSZtT5DxCQCzUAfTkR1e8I4/F7tYFT/2Xn5+WMIMdlacY/kpODmOmOWyY8ke+c8Y3S98J4as/Y3PD/foHSAqxRqmcmieafCcTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nicY3ca3R92qUN1jbPcdKmXD0ZXhq/pTwlChXf8ikP8=; b=fjHWdLQh4mirJD/5rvWncVgBIRxqTP2SL5n+sf/BCT+SWr2hstsg5G2my2qFaAGNWcv5MaOJ+c0WM1Tygy9BvRlYmjw7VdxkBI5j+qRD+24sEeyNdZqhhIumxpAC6meUzMsAD7wsfLy2U/HcmvZqaBHmkXXIlgLG07d1ImbEmuzztQvpUIqB2FJA/UpDrrPejAp5UEodArbaRmRP3kCisZ81uYT0U8paQY2Kqa7CJ5rV0pI1yuSA/GDhy3Mq4+HF9lPYZ4cc6ENTCAK6BWQz5AfUHtC6FTygpX4kZmGWcGyfr+qWRWLkXYe7t1vEqC1v4fg3eJIdeUkXznQegKStIg== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by PH0PR84MB2025.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:160::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.14; Fri, 27 Dec 2024 22:21:36 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%4]) with mapi id 15.20.8293.000; Fri, 27 Dec 2024 22:21:36 +0000 From: Morgan Smith <Morgan.J.Smith@HIDDEN> To: guix-patches@HIDDEN Subject: [PATCH] import/utils: beautify-description: Validate argument Date: Fri, 27 Dec 2024 17:18:38 -0500 Message-ID: <CH3PR84MB3424E6AE9729DF52B792B1D5C50E2@HIDDEN> X-Mailer: git-send-email 2.47.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT4PR01CA0411.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10b::28) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <75e7d7862811d04bc08e32e92804d370173100d0.1735337917.git.Morgan.J.Smith@HIDDEN> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|PH0PR84MB2025:EE_ X-MS-Office365-Filtering-Correlation-Id: d6804579-53ab-4d2f-039b-08dd26c4d3b4 X-Microsoft-Antispam: BCL:0; ARA:14566002|7092599003|8060799006|19110799003|461199028|5072599009|15080799006|3412199025|440099028|1710799026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?tMo+bC/IgxCIWLdezVGOa6Qa9QpMSULTZt8dMFZisyYurg8Pp7P5K4J2nPgX?= =?us-ascii?Q?adukt2zEJE1j0QFwqhx0NnmRgj7MBLRj+iBkUScBxkJpe1VjbpytvoC7qjni?= =?us-ascii?Q?96pRn/jOAAyCGJf7Sojv/tnl+mAIlEMvB/2xvcJvir4iC+/Vygxx+U36qvj0?= =?us-ascii?Q?Ko5fUpsuob6bROT/+0WKa11NacDIUAU94Puoju7IO6Yaaut93m1kmCVCQ70q?= =?us-ascii?Q?HnJbM+noMYvs7vuI9YOVoJYGXjqOkjXiHO6hVC1CfR8puBnwSqextAuy/VP4?= =?us-ascii?Q?j+hmdTkJ6Yn+kgXHxHCYYX7tXLt25iAgh+AH0LO4vmB5blmV8v7v1n9QNjaZ?= =?us-ascii?Q?GyH7ImthdtfuW0I8SntWy4A53pJiZJxqERzkZUDlk3Z3HZ+JSNdpluPDltzr?= =?us-ascii?Q?HNYOP4uDeL5M7SADxNgxAt4FgH25/Fie1EJ5HU3/xwp6BH4RGbCeBlVkWP3N?= =?us-ascii?Q?oEsGORKBxVuv8NiW2Y8fDi29du2anFGZ16xDiHdgfUP7Gyw9JJoU7dk0WaXw?= =?us-ascii?Q?Tif9/leT0joQ9zKTnYKWDZpZEWPG9qbE5losZ9oy7I7YSkfk549Ba2cRc/gR?= =?us-ascii?Q?o2wAtBff/59kdXhZjl58uu/iK9GtLhYQTPIRC29Q6AVg913zqXwp3sywKg3E?= =?us-ascii?Q?8+HcMqDQKHvSmUhR8Y+sgZpHQDHdYDPxYlaxqDc0hxBL3PAG3lqq+QxXk4rv?= =?us-ascii?Q?bpQdahOEK7f3+JwWtgK9e7SmTcYnOqydt0FO7DQ/yrbfsd7jAzMhA3rgkPVb?= =?us-ascii?Q?7QKmugCMVCtkDe0dsFPdyohL1MwTvw06maIPPxbwiiiB3BjVpAjDLk4CGZHL?= =?us-ascii?Q?560dp4kV6FzF0gAvX9DGA6MqSY2lTeaH5IHMsJvIbzj9wM+yo3cy2W5pJymP?= =?us-ascii?Q?ADA0m/NP0mOQYRpGUEoreYDjbpf6TVSDT2wvNfGc1mQWtShmqQVgG+EUYVRB?= =?us-ascii?Q?NH8sqyutmQTgfMiimCay+P1LpFo+NpUYQ8f8AbzB0ddLzWiuWAow8ppTAU8D?= =?us-ascii?Q?JsFFGwpnui7wO9MrC7CAW8IK1I+Q3kVYpAhbts2LyFRp2TBTTc7V0sPqqnmD?= =?us-ascii?Q?BgdBVc4XCb07ibZuaq6sQ9ohynFTn2o7zhlRBLvpgDMxD+nsd80=3D?= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?i5wS+yY8TGUUw7Ne/YZzCJORkT0BNOYY2FveAzBQsLQtxHn2a4trSqCLqsPU?= =?us-ascii?Q?y357v+UKA1GBlE3edmKxRc5JNqKdtuo5AKEdZTqouPZLrHdZwNIWBK3REVNi?= =?us-ascii?Q?P3R5LGMIwvQpeWOSHcbDSKgql/igEKVmBVzy9PiSlHQI2b3tW5WI4MReNDba?= =?us-ascii?Q?8l7t3e/iEG4rFIjMLGqr7A1jKddB3pJqnrXdfcQarh9l4EIr68sxX+tg2DGy?= =?us-ascii?Q?tI+40DaMK6aQ+UVlqdcKoX7kkcOK+QyNZe20YiLDtGYWLLWU+L3voJ9X42wY?= =?us-ascii?Q?iJvuuMNMPY8xGMGYenPOXBogfPqMneA6KN0xNAqXIJWEXhcXOGDSNVweoOK8?= =?us-ascii?Q?fwYqtn4QKVKr1+09n0ttsntrDzPM9yfsE6YJUYhCQY1PIRYFR0Fb/62b19C0?= =?us-ascii?Q?8BvT0K+GXC0aMK9+7Osg2eqkwo8EihKnTL4bxkXGnPVBrkuZJ0WYlVZBtCFj?= =?us-ascii?Q?AnJJEo5YG37+Gg9gCNwReN1T0RjCgmBGg3y3U3OqOMTZ0vMSlR6y95/1kS2m?= =?us-ascii?Q?sOL35NTtDGBKqXYe5wRO6g0zCndzYbFtnO2LnU3Y/WE5XJp36QbIM2iTQotP?= =?us-ascii?Q?pMgVYl+exRPO8mWnKI7+7ibDvAojCoKFutAxReeMgy8Onz1yqT1P4LxiiJWo?= =?us-ascii?Q?sm4/F5LHmS7ZTUda1KWJnJB5NmVZ3d9HWtabhJ0N2Uwvm80BWzJ3VipC8qCJ?= =?us-ascii?Q?YyREZa1PPAqQjXrnMA5t6aFV5jY5A40r83h3zT/Og4G6Sntt+/FF/27jaAK/?= =?us-ascii?Q?1hTvPUEIzzK0krFb9Ls+3hTUd2AaMdrOd5sCz+qEsSbvVqqXRSIWxD8Tpuna?= =?us-ascii?Q?buU7KxXpT2glfwWCHPb7Airs9sutii9dXoajAThN83a50CdPs6WcEZ5Mh6j6?= =?us-ascii?Q?5H7rPznjTZSMR5rzyZMEN7yg+AqOWmv4s78xOO6KImmM7AB4erWzm0/aTDdc?= =?us-ascii?Q?MSo4Y41GU3gWvpnoagNXWA8fAOj6lz6A2Hm5XbGR8vcZM/Qfo2cR4uOWw02J?= =?us-ascii?Q?D/KSRnU3o6wIqR4dKA4XOd49JminESTw8z0+oYwemhNatm7vMEJxk/GYFOdN?= =?us-ascii?Q?VRzP7omlPFqgvZnGdtmvM4DpThidE64dxMDteahhWBxJYz5hxou+2ceaxLaa?= =?us-ascii?Q?qlew4vTrl/fXt+ek2qDLAGjuogOHwCQEvyibYoA2QK/HWH0/mWTBLf3M3Ign?= =?us-ascii?Q?5gwl0t0Dl/UCeZ9Mr6POtqBE7rFUGw95yD/87K9bLyn9owJz0gELZIlLY8O/?= =?us-ascii?Q?C+34EjsIgEe9cuM3EbsP?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6804579-53ab-4d2f-039b-08dd26c4d3b4 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2024 22:21:36.6320 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR84MB2025 Received-SPF: pass client-ip=40.92.41.32; envelope-from=Morgan.J.Smith@HIDDEN; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Morgan Smith <Morgan.J.Smith@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) * guix/import/utils.scm (beautify-description): Fix broken check for non-strings. Add a check for empty strings. * tests/import-utils.scm: Add two tests. Change-Id: Idf86df02aeb850fcc8808b7c9251082c1f816656 --- Hello! I was trying to run "guix import hackage orgstat" to no avail. It turns out it was because 'beautify-description' errors when given the empty string. It already had a check for arguments that where not a string but that check was actually broken. So I fixed the existing check and added a new one for an empty string. guix/import/utils.scm | 160 +++++++++++++++++++++-------------------- tests/import-utils.scm | 10 +++ 2 files changed, 91 insertions(+), 79 deletions(-) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index e45c8dfb20..bb268ebe4b 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -328,85 +328,87 @@ (define* (beautify-description description #:optional (length 80)) "Improve the package DESCRIPTION by turning a beginning sentence fragment into a proper sentence and by using two spaces between sentences, and wrap lines at LENGTH characters." - (unless (string? description) - (G_ "This package lacks a description. Run \ -\"info '(guix) Synopses and Descriptions'\" for more information.")) - - (let* ((fix-word - (lambda (word) - (fold (lambda (proc acc) (proc acc)) word - (list - ;; Remove wrapping in single quotes, common in R packages. - (cut string-trim-both <> #\') - ;; Escape single @ to prevent it from being understood as - ;; invalid Texinfo syntax. - (cut regexp-substitute/global #f "@" <> 'pre "@@" 'post) - ;; Wrap camelCase or PascalCase words or text followed - ;; immediately by "()" in @code{...}. - (lambda (word) - (let ((pattern - (make-regexp - "([A-Z][a-z]+[A-Z]|[a-z]+[A-Z]|.+\\(\\))"))) - (match (list-matches pattern word) - (() word) - ((m . rest) - ;; Do not include leading or trailing punctuation, - ;; unless its "()". - (let* ((last-text (if (string-suffix? "()" (match:substring m 1)) - (string-length (match:substring m 1)) - (or (and=> (string-skip-right word char-set:punctuation) 1+) - (string-length word)))) - (inner (substring word (match:start m) last-text)) - (pre (string-take word (match:start m))) - (post (substring word last-text (string-length word)))) - (string-append pre "@code{" inner "}" post)))))))))) - (words - (string-tokenize (string-trim-both description) - (char-set-complement - (char-set #\space #\newline)))) - (new-words - (match words - (((and (or "A" "Classes" "Functions" "Methods" "Tools") - first) . rest) - (cons* "This" "package" "provides" - (string-downcase first) rest)) - (((and (or "Contains" - "Creates" - "Performs" - "Provides" - "Produces" - "Implements" - "Infers") first) . rest) - (cons* "This" "package" - (string-downcase first) rest)) - (_ words))) - (new-words - (match new-words - ((rest ... last) - (reverse (cons (if (or (string-suffix? "." last) - (string-suffix? "!" last) - (string-suffix? "?" last)) - last - (string-append last ".")) - (reverse rest)))))) - (cleaned - (string-join (map fix-word new-words)))) - ;; Use double spacing between sentences - (fill-paragraph (regexp-substitute/global #f "\\. \\b" - cleaned 'pre - (lambda (m) - (let ((pre (match:prefix m)) - (abbrevs '("Dr" "Mr" "Mrs" - "Ms" "Prof" "vs" - "e.g"))) - (if (and (> (string-length pre) 0) - (or (any (cut string-suffix? <> pre) abbrevs) - (char-upper-case? - (string-ref pre (1- (string-length pre)))))) - ". " - ". "))) - 'post) - length))) + (if (or (not (string? description)) (string=? (string-trim-both description) "")) + (G_ "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information.") + + (let* ((fix-word + (lambda (word) + (fold (lambda (proc acc) (proc acc)) word + (list + ;; Remove wrapping in single quotes, common in R packages. + (cut string-trim-both <> #\') + ;; Escape single @ to prevent it from being understood as + ;; invalid Texinfo syntax. + (cut regexp-substitute/global #f "@" <> 'pre "@@" 'post) + ;; Wrap camelCase or PascalCase words or text followed + ;; immediately by "()" in @code{...}. + (lambda (word) + (let ((pattern + (make-regexp + "([A-Z][a-z]+[A-Z]|[a-z]+[A-Z]|.+\\(\\))"))) + (match (list-matches pattern word) + (() word) + ((m . rest) + ;; Do not include leading or trailing punctuation, + ;; unless its "()". + (let* ((last-text + (if (string-suffix? "()" (match:substring m 1)) + (string-length (match:substring m 1)) + (or (and=> (string-skip-right word char-set:punctuation) 1+) + (string-length word)))) + (inner (substring word (match:start m) last-text)) + (pre (string-take word (match:start m))) + (post (substring word last-text (string-length word)))) + (string-append pre "@code{" inner "}" post)))))))))) + (words + (string-tokenize (string-trim-both description) + (char-set-complement + (char-set #\space #\newline)))) + (new-words + (match words + (((and (or "A" "Classes" "Functions" "Methods" "Tools") + first) . rest) + (cons* "This" "package" "provides" + (string-downcase first) rest)) + (((and (or "Contains" + "Creates" + "Performs" + "Provides" + "Produces" + "Implements" + "Infers") first) . rest) + (cons* "This" "package" + (string-downcase first) rest)) + (_ words))) + (new-words + (match new-words + ((rest ... last) + (reverse (cons (if (or (string-suffix? "." last) + (string-suffix? "!" last) + (string-suffix? "?" last)) + last + (string-append last ".")) + (reverse rest)))))) + (cleaned + (string-join (map fix-word new-words)))) + ;; Use double spacing between sentences + (fill-paragraph + (regexp-substitute/global #f "\\. \\b" + cleaned 'pre + (lambda (m) + (let ((pre (match:prefix m)) + (abbrevs '("Dr" "Mr" "Mrs" + "Ms" "Prof" "vs" + "e.g"))) + (if (and (> (string-length pre) 0) + (or (any (cut string-suffix? <> pre) abbrevs) + (char-upper-case? + (string-ref pre (1- (string-length pre)))))) + ". " + ". "))) + 'post) + length)))) (define (beautify-synopsis synopsis) "Improve the package SYNOPSIS." diff --git a/tests/import-utils.scm b/tests/import-utils.scm index 607349203c..27bd87940a 100644 --- a/tests/import-utils.scm +++ b/tests/import-utils.scm @@ -31,6 +31,16 @@ (define-module (test-import-utils) (test-begin "import-utils") +(test-equal "beautify-description: empty string" + "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information." + (beautify-description "")) + +(test-equal "beautify-description: not a string" + "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information." + (beautify-description '())) + (test-equal "beautify-description: use double spacing" "\ Trust me Mr. Hendrix, M. Night Shyamalan et al. \ base-commit: 3a8c20408f0078a580d27f74bc69b5a1069a003b -- 2.47.1 ------------=_1744705506-27834-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 75151-done) by debbugs.gnu.org; 15 Apr 2025 08:24:49 +0000 Received: from localhost ([127.0.0.1]:50498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1u4bb7-0007Cs-EC for submit <at> debbugs.gnu.org; Tue, 15 Apr 2025 04:24:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60768) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1u4bb4-0007C4-6G for 75151-done <at> debbugs.gnu.org; Tue, 15 Apr 2025 04:24:46 -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 <ludo@HIDDEN>) id 1u4bay-0003Xs-Jl; Tue, 15 Apr 2025 04:24:40 -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:References:In-Reply-To:Subject:To: From; bh=myHumi3HS6T9I4bFH0mxB8dKUIVmbOums6zdTjyd/Rw=; b=MFYwiU//Lkgxa1Te5AW+ B7ODSyZjkrJMBVrdO5mQ51GCDXvRpoazAhDMLkHR815m3l5plf4YzBOQVgSi5iXvU1xFm3I2t1z1N PVlnj03OTqOuIR1triikuKpGMeg0BTzH+qS9ZNOabrJZh/63ADZQvKsWa4oyW7fFXMhssHTCqtkvg hSHOyYU1aNRVf7ihAvyVSvwZjKMaSTnrDgCZFe93OZhoNJPCRzG8QwNciGobosnunlSTn9Kz2e9wR o/np1FNIwOwMSxw3pRFKPt/6xHmj8Oh/TQNhOMdi1gjiS9kyTJNltY/h1jInxEhBp1GRJ7wWSOT/u f9T7h0lt5Vsi7A==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Morgan Smith <Morgan.J.Smith@HIDDEN> Subject: Re: bug#75151: [PATCH] import/utils: beautify-description: Validate argument In-Reply-To: <CH3PR84MB34244D12FFD3500FA35CB965C5AA2@HIDDEN> (Morgan Smith's message of "Mon, 7 Apr 2025 16:53:52 -0400") References: <CH3PR84MB3424E6AE9729DF52B792B1D5C50E2@HIDDEN> <CH3PR84MB34244D12FFD3500FA35CB965C5AA2@HIDDEN> Date: Tue, 15 Apr 2025 10:20:05 +0200 Message-ID: <87h62pkf9m.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75151-done Cc: 75151-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Morgan Smith <Morgan.J.Smith@HIDDEN> writes: > * guix/import/utils.scm (beautify-description): Fix broken check for > non-strings. Add a check for empty strings. > * tests/import-utils.scm: Add two tests. > > Change-Id: Idf86df02aeb850fcc8808b7c9251082c1f816656 Applied, thanks! ------------=_1744705506-27834-0--
MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Morgan Smith <Morgan.J.Smith@HIDDEN> Subject: bug#75151: closed (Re: bug#75151: [PATCH] import/utils: beautify-description: Validate argument) Message-ID: <handler.75151.D75151.174470548927716.notifdone <at> debbugs.gnu.org> References: <87h62pkf9m.fsf_-_@HIDDEN> <CH3PR84MB3424E6AE9729DF52B792B1D5C50E2@HIDDEN> X-Gnu-PR-Message: they-closed 75151 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 75151 <at> debbugs.gnu.org Date: Tue, 15 Apr 2025 08:25:06 +0000 Content-Type: multipart/mixed; boundary="----------=_1744705506-27834-1" This is a multi-part message in MIME format... ------------=_1744705506-27834-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #75151: [PATCH] import/utils: beautify-description: Validate argument 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 75151 <at> debbugs.gnu.org. --=20 75151: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D75151 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems ------------=_1744705506-27834-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 75151-done) by debbugs.gnu.org; 15 Apr 2025 08:24:49 +0000 Received: from localhost ([127.0.0.1]:50498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1u4bb7-0007Cs-EC for submit <at> debbugs.gnu.org; Tue, 15 Apr 2025 04:24:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60768) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1u4bb4-0007C4-6G for 75151-done <at> debbugs.gnu.org; Tue, 15 Apr 2025 04:24:46 -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 <ludo@HIDDEN>) id 1u4bay-0003Xs-Jl; Tue, 15 Apr 2025 04:24:40 -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:References:In-Reply-To:Subject:To: From; bh=myHumi3HS6T9I4bFH0mxB8dKUIVmbOums6zdTjyd/Rw=; b=MFYwiU//Lkgxa1Te5AW+ B7ODSyZjkrJMBVrdO5mQ51GCDXvRpoazAhDMLkHR815m3l5plf4YzBOQVgSi5iXvU1xFm3I2t1z1N PVlnj03OTqOuIR1triikuKpGMeg0BTzH+qS9ZNOabrJZh/63ADZQvKsWa4oyW7fFXMhssHTCqtkvg hSHOyYU1aNRVf7ihAvyVSvwZjKMaSTnrDgCZFe93OZhoNJPCRzG8QwNciGobosnunlSTn9Kz2e9wR o/np1FNIwOwMSxw3pRFKPt/6xHmj8Oh/TQNhOMdi1gjiS9kyTJNltY/h1jInxEhBp1GRJ7wWSOT/u f9T7h0lt5Vsi7A==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Morgan Smith <Morgan.J.Smith@HIDDEN> Subject: Re: bug#75151: [PATCH] import/utils: beautify-description: Validate argument In-Reply-To: <CH3PR84MB34244D12FFD3500FA35CB965C5AA2@HIDDEN> (Morgan Smith's message of "Mon, 7 Apr 2025 16:53:52 -0400") References: <CH3PR84MB3424E6AE9729DF52B792B1D5C50E2@HIDDEN> <CH3PR84MB34244D12FFD3500FA35CB965C5AA2@HIDDEN> Date: Tue, 15 Apr 2025 10:20:05 +0200 Message-ID: <87h62pkf9m.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75151-done Cc: 75151-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Morgan Smith <Morgan.J.Smith@HIDDEN> writes: > * guix/import/utils.scm (beautify-description): Fix broken check for > non-strings. Add a check for empty strings. > * tests/import-utils.scm: Add two tests. > > Change-Id: Idf86df02aeb850fcc8808b7c9251082c1f816656 Applied, thanks! ------------=_1744705506-27834-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 27 Dec 2024 22:21:46 +0000 Received: from localhost ([127.0.0.1]:47883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tRIiH-0003Hv-7P for submit <at> debbugs.gnu.org; Fri, 27 Dec 2024 17:21:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:59734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <Morgan.J.Smith@HIDDEN>) id 1tRIiE-0003Hj-LK for submit <at> debbugs.gnu.org; Fri, 27 Dec 2024 17:21:43 -0500 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 <Morgan.J.Smith@HIDDEN>) id 1tRIiE-0000S3-91 for guix-patches@HIDDEN; Fri, 27 Dec 2024 17:21:42 -0500 Received: from mail-dm6nam10olkn2032.outbound.protection.outlook.com ([40.92.41.32] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Morgan.J.Smith@HIDDEN>) id 1tRIiC-0001b0-6R for guix-patches@HIDDEN; Fri, 27 Dec 2024 17:21:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UiKtE5/p7cKZVpYQn4s8x4MpATJ8PoSdHV26Duy/m8lGpEJy5yr3F0bfOqgQ6qbNeCPYUHuKiLTvD+7IfoOp/Kyqp0Z0p8fZkUbugs/li1xoLDdOAIGb9m6EkHXroK7jMF+6D8vp/xLMgAIika12tpwi0xCZWwyyqxvyB9FyNLEadNtp+XKBkbb9MxI1yRvYBxKRD0lbQyRNFt/3/EGZcPlfZ8mjEA6PrAEC2ifNDXgulG6sIf1tMcnLjrViaxdmcOsBhdCAjiYQKjq64o9biUVf3B40zjGgtHlP4uFEvQg+IyToYivJiWAEYo4cqsWCKCNm2r6swZ9RQAHFUyL6+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nicY3ca3R92qUN1jbPcdKmXD0ZXhq/pTwlChXf8ikP8=; b=P7n3aQrH3KAaE3WAk73E+xk/UDQ0e7z2o91M0twEkKAnCuriVdeAFuZpSpslf+QKzsABgBCQRat1rg6WUYfDWWncvw9ku0IkUgkWbc6scfjgMboaYv3PhnDPr4nUtGVHL9NPBVqzlrFWe4peT41ywjrT46utuXKhmA9KOreC6M2kPIUmkeR0opEx7pdHrNGcUokPDzmX/RZu37a2xWZH8P18Q7fVhavL1i7zJ9nXBLyq9/HBjCxFiSZtT5DxCQCzUAfTkR1e8I4/F7tYFT/2Xn5+WMIMdlacY/kpODmOmOWyY8ke+c8Y3S98J4as/Y3PD/foHSAqxRqmcmieafCcTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nicY3ca3R92qUN1jbPcdKmXD0ZXhq/pTwlChXf8ikP8=; b=fjHWdLQh4mirJD/5rvWncVgBIRxqTP2SL5n+sf/BCT+SWr2hstsg5G2my2qFaAGNWcv5MaOJ+c0WM1Tygy9BvRlYmjw7VdxkBI5j+qRD+24sEeyNdZqhhIumxpAC6meUzMsAD7wsfLy2U/HcmvZqaBHmkXXIlgLG07d1ImbEmuzztQvpUIqB2FJA/UpDrrPejAp5UEodArbaRmRP3kCisZ81uYT0U8paQY2Kqa7CJ5rV0pI1yuSA/GDhy3Mq4+HF9lPYZ4cc6ENTCAK6BWQz5AfUHtC6FTygpX4kZmGWcGyfr+qWRWLkXYe7t1vEqC1v4fg3eJIdeUkXznQegKStIg== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by PH0PR84MB2025.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:160::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.14; Fri, 27 Dec 2024 22:21:36 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%4]) with mapi id 15.20.8293.000; Fri, 27 Dec 2024 22:21:36 +0000 From: Morgan Smith <Morgan.J.Smith@HIDDEN> To: guix-patches@HIDDEN Subject: [PATCH] import/utils: beautify-description: Validate argument Date: Fri, 27 Dec 2024 17:18:38 -0500 Message-ID: <CH3PR84MB3424E6AE9729DF52B792B1D5C50E2@HIDDEN> X-Mailer: git-send-email 2.47.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT4PR01CA0411.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10b::28) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <75e7d7862811d04bc08e32e92804d370173100d0.1735337917.git.Morgan.J.Smith@HIDDEN> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|PH0PR84MB2025:EE_ X-MS-Office365-Filtering-Correlation-Id: d6804579-53ab-4d2f-039b-08dd26c4d3b4 X-Microsoft-Antispam: BCL:0; ARA:14566002|7092599003|8060799006|19110799003|461199028|5072599009|15080799006|3412199025|440099028|1710799026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?tMo+bC/IgxCIWLdezVGOa6Qa9QpMSULTZt8dMFZisyYurg8Pp7P5K4J2nPgX?= =?us-ascii?Q?adukt2zEJE1j0QFwqhx0NnmRgj7MBLRj+iBkUScBxkJpe1VjbpytvoC7qjni?= =?us-ascii?Q?96pRn/jOAAyCGJf7Sojv/tnl+mAIlEMvB/2xvcJvir4iC+/Vygxx+U36qvj0?= =?us-ascii?Q?Ko5fUpsuob6bROT/+0WKa11NacDIUAU94Puoju7IO6Yaaut93m1kmCVCQ70q?= =?us-ascii?Q?HnJbM+noMYvs7vuI9YOVoJYGXjqOkjXiHO6hVC1CfR8puBnwSqextAuy/VP4?= =?us-ascii?Q?j+hmdTkJ6Yn+kgXHxHCYYX7tXLt25iAgh+AH0LO4vmB5blmV8v7v1n9QNjaZ?= =?us-ascii?Q?GyH7ImthdtfuW0I8SntWy4A53pJiZJxqERzkZUDlk3Z3HZ+JSNdpluPDltzr?= =?us-ascii?Q?HNYOP4uDeL5M7SADxNgxAt4FgH25/Fie1EJ5HU3/xwp6BH4RGbCeBlVkWP3N?= =?us-ascii?Q?oEsGORKBxVuv8NiW2Y8fDi29du2anFGZ16xDiHdgfUP7Gyw9JJoU7dk0WaXw?= =?us-ascii?Q?Tif9/leT0joQ9zKTnYKWDZpZEWPG9qbE5losZ9oy7I7YSkfk549Ba2cRc/gR?= =?us-ascii?Q?o2wAtBff/59kdXhZjl58uu/iK9GtLhYQTPIRC29Q6AVg913zqXwp3sywKg3E?= =?us-ascii?Q?8+HcMqDQKHvSmUhR8Y+sgZpHQDHdYDPxYlaxqDc0hxBL3PAG3lqq+QxXk4rv?= =?us-ascii?Q?bpQdahOEK7f3+JwWtgK9e7SmTcYnOqydt0FO7DQ/yrbfsd7jAzMhA3rgkPVb?= =?us-ascii?Q?7QKmugCMVCtkDe0dsFPdyohL1MwTvw06maIPPxbwiiiB3BjVpAjDLk4CGZHL?= =?us-ascii?Q?560dp4kV6FzF0gAvX9DGA6MqSY2lTeaH5IHMsJvIbzj9wM+yo3cy2W5pJymP?= =?us-ascii?Q?ADA0m/NP0mOQYRpGUEoreYDjbpf6TVSDT2wvNfGc1mQWtShmqQVgG+EUYVRB?= =?us-ascii?Q?NH8sqyutmQTgfMiimCay+P1LpFo+NpUYQ8f8AbzB0ddLzWiuWAow8ppTAU8D?= =?us-ascii?Q?JsFFGwpnui7wO9MrC7CAW8IK1I+Q3kVYpAhbts2LyFRp2TBTTc7V0sPqqnmD?= =?us-ascii?Q?BgdBVc4XCb07ibZuaq6sQ9ohynFTn2o7zhlRBLvpgDMxD+nsd80=3D?= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?i5wS+yY8TGUUw7Ne/YZzCJORkT0BNOYY2FveAzBQsLQtxHn2a4trSqCLqsPU?= =?us-ascii?Q?y357v+UKA1GBlE3edmKxRc5JNqKdtuo5AKEdZTqouPZLrHdZwNIWBK3REVNi?= =?us-ascii?Q?P3R5LGMIwvQpeWOSHcbDSKgql/igEKVmBVzy9PiSlHQI2b3tW5WI4MReNDba?= =?us-ascii?Q?8l7t3e/iEG4rFIjMLGqr7A1jKddB3pJqnrXdfcQarh9l4EIr68sxX+tg2DGy?= =?us-ascii?Q?tI+40DaMK6aQ+UVlqdcKoX7kkcOK+QyNZe20YiLDtGYWLLWU+L3voJ9X42wY?= =?us-ascii?Q?iJvuuMNMPY8xGMGYenPOXBogfPqMneA6KN0xNAqXIJWEXhcXOGDSNVweoOK8?= =?us-ascii?Q?fwYqtn4QKVKr1+09n0ttsntrDzPM9yfsE6YJUYhCQY1PIRYFR0Fb/62b19C0?= =?us-ascii?Q?8BvT0K+GXC0aMK9+7Osg2eqkwo8EihKnTL4bxkXGnPVBrkuZJ0WYlVZBtCFj?= =?us-ascii?Q?AnJJEo5YG37+Gg9gCNwReN1T0RjCgmBGg3y3U3OqOMTZ0vMSlR6y95/1kS2m?= =?us-ascii?Q?sOL35NTtDGBKqXYe5wRO6g0zCndzYbFtnO2LnU3Y/WE5XJp36QbIM2iTQotP?= =?us-ascii?Q?pMgVYl+exRPO8mWnKI7+7ibDvAojCoKFutAxReeMgy8Onz1yqT1P4LxiiJWo?= =?us-ascii?Q?sm4/F5LHmS7ZTUda1KWJnJB5NmVZ3d9HWtabhJ0N2Uwvm80BWzJ3VipC8qCJ?= =?us-ascii?Q?YyREZa1PPAqQjXrnMA5t6aFV5jY5A40r83h3zT/Og4G6Sntt+/FF/27jaAK/?= =?us-ascii?Q?1hTvPUEIzzK0krFb9Ls+3hTUd2AaMdrOd5sCz+qEsSbvVqqXRSIWxD8Tpuna?= =?us-ascii?Q?buU7KxXpT2glfwWCHPb7Airs9sutii9dXoajAThN83a50CdPs6WcEZ5Mh6j6?= =?us-ascii?Q?5H7rPznjTZSMR5rzyZMEN7yg+AqOWmv4s78xOO6KImmM7AB4erWzm0/aTDdc?= =?us-ascii?Q?MSo4Y41GU3gWvpnoagNXWA8fAOj6lz6A2Hm5XbGR8vcZM/Qfo2cR4uOWw02J?= =?us-ascii?Q?D/KSRnU3o6wIqR4dKA4XOd49JminESTw8z0+oYwemhNatm7vMEJxk/GYFOdN?= =?us-ascii?Q?VRzP7omlPFqgvZnGdtmvM4DpThidE64dxMDteahhWBxJYz5hxou+2ceaxLaa?= =?us-ascii?Q?qlew4vTrl/fXt+ek2qDLAGjuogOHwCQEvyibYoA2QK/HWH0/mWTBLf3M3Ign?= =?us-ascii?Q?5gwl0t0Dl/UCeZ9Mr6POtqBE7rFUGw95yD/87K9bLyn9owJz0gELZIlLY8O/?= =?us-ascii?Q?C+34EjsIgEe9cuM3EbsP?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6804579-53ab-4d2f-039b-08dd26c4d3b4 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2024 22:21:36.6320 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR84MB2025 Received-SPF: pass client-ip=40.92.41.32; envelope-from=Morgan.J.Smith@HIDDEN; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Morgan Smith <Morgan.J.Smith@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) * guix/import/utils.scm (beautify-description): Fix broken check for non-strings. Add a check for empty strings. * tests/import-utils.scm: Add two tests. Change-Id: Idf86df02aeb850fcc8808b7c9251082c1f816656 --- Hello! I was trying to run "guix import hackage orgstat" to no avail. It turns out it was because 'beautify-description' errors when given the empty string. It already had a check for arguments that where not a string but that check was actually broken. So I fixed the existing check and added a new one for an empty string. guix/import/utils.scm | 160 +++++++++++++++++++++-------------------- tests/import-utils.scm | 10 +++ 2 files changed, 91 insertions(+), 79 deletions(-) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index e45c8dfb20..bb268ebe4b 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -328,85 +328,87 @@ (define* (beautify-description description #:optional (length 80)) "Improve the package DESCRIPTION by turning a beginning sentence fragment into a proper sentence and by using two spaces between sentences, and wrap lines at LENGTH characters." - (unless (string? description) - (G_ "This package lacks a description. Run \ -\"info '(guix) Synopses and Descriptions'\" for more information.")) - - (let* ((fix-word - (lambda (word) - (fold (lambda (proc acc) (proc acc)) word - (list - ;; Remove wrapping in single quotes, common in R packages. - (cut string-trim-both <> #\') - ;; Escape single @ to prevent it from being understood as - ;; invalid Texinfo syntax. - (cut regexp-substitute/global #f "@" <> 'pre "@@" 'post) - ;; Wrap camelCase or PascalCase words or text followed - ;; immediately by "()" in @code{...}. - (lambda (word) - (let ((pattern - (make-regexp - "([A-Z][a-z]+[A-Z]|[a-z]+[A-Z]|.+\\(\\))"))) - (match (list-matches pattern word) - (() word) - ((m . rest) - ;; Do not include leading or trailing punctuation, - ;; unless its "()". - (let* ((last-text (if (string-suffix? "()" (match:substring m 1)) - (string-length (match:substring m 1)) - (or (and=> (string-skip-right word char-set:punctuation) 1+) - (string-length word)))) - (inner (substring word (match:start m) last-text)) - (pre (string-take word (match:start m))) - (post (substring word last-text (string-length word)))) - (string-append pre "@code{" inner "}" post)))))))))) - (words - (string-tokenize (string-trim-both description) - (char-set-complement - (char-set #\space #\newline)))) - (new-words - (match words - (((and (or "A" "Classes" "Functions" "Methods" "Tools") - first) . rest) - (cons* "This" "package" "provides" - (string-downcase first) rest)) - (((and (or "Contains" - "Creates" - "Performs" - "Provides" - "Produces" - "Implements" - "Infers") first) . rest) - (cons* "This" "package" - (string-downcase first) rest)) - (_ words))) - (new-words - (match new-words - ((rest ... last) - (reverse (cons (if (or (string-suffix? "." last) - (string-suffix? "!" last) - (string-suffix? "?" last)) - last - (string-append last ".")) - (reverse rest)))))) - (cleaned - (string-join (map fix-word new-words)))) - ;; Use double spacing between sentences - (fill-paragraph (regexp-substitute/global #f "\\. \\b" - cleaned 'pre - (lambda (m) - (let ((pre (match:prefix m)) - (abbrevs '("Dr" "Mr" "Mrs" - "Ms" "Prof" "vs" - "e.g"))) - (if (and (> (string-length pre) 0) - (or (any (cut string-suffix? <> pre) abbrevs) - (char-upper-case? - (string-ref pre (1- (string-length pre)))))) - ". " - ". "))) - 'post) - length))) + (if (or (not (string? description)) (string=? (string-trim-both description) "")) + (G_ "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information.") + + (let* ((fix-word + (lambda (word) + (fold (lambda (proc acc) (proc acc)) word + (list + ;; Remove wrapping in single quotes, common in R packages. + (cut string-trim-both <> #\') + ;; Escape single @ to prevent it from being understood as + ;; invalid Texinfo syntax. + (cut regexp-substitute/global #f "@" <> 'pre "@@" 'post) + ;; Wrap camelCase or PascalCase words or text followed + ;; immediately by "()" in @code{...}. + (lambda (word) + (let ((pattern + (make-regexp + "([A-Z][a-z]+[A-Z]|[a-z]+[A-Z]|.+\\(\\))"))) + (match (list-matches pattern word) + (() word) + ((m . rest) + ;; Do not include leading or trailing punctuation, + ;; unless its "()". + (let* ((last-text + (if (string-suffix? "()" (match:substring m 1)) + (string-length (match:substring m 1)) + (or (and=> (string-skip-right word char-set:punctuation) 1+) + (string-length word)))) + (inner (substring word (match:start m) last-text)) + (pre (string-take word (match:start m))) + (post (substring word last-text (string-length word)))) + (string-append pre "@code{" inner "}" post)))))))))) + (words + (string-tokenize (string-trim-both description) + (char-set-complement + (char-set #\space #\newline)))) + (new-words + (match words + (((and (or "A" "Classes" "Functions" "Methods" "Tools") + first) . rest) + (cons* "This" "package" "provides" + (string-downcase first) rest)) + (((and (or "Contains" + "Creates" + "Performs" + "Provides" + "Produces" + "Implements" + "Infers") first) . rest) + (cons* "This" "package" + (string-downcase first) rest)) + (_ words))) + (new-words + (match new-words + ((rest ... last) + (reverse (cons (if (or (string-suffix? "." last) + (string-suffix? "!" last) + (string-suffix? "?" last)) + last + (string-append last ".")) + (reverse rest)))))) + (cleaned + (string-join (map fix-word new-words)))) + ;; Use double spacing between sentences + (fill-paragraph + (regexp-substitute/global #f "\\. \\b" + cleaned 'pre + (lambda (m) + (let ((pre (match:prefix m)) + (abbrevs '("Dr" "Mr" "Mrs" + "Ms" "Prof" "vs" + "e.g"))) + (if (and (> (string-length pre) 0) + (or (any (cut string-suffix? <> pre) abbrevs) + (char-upper-case? + (string-ref pre (1- (string-length pre)))))) + ". " + ". "))) + 'post) + length)))) (define (beautify-synopsis synopsis) "Improve the package SYNOPSIS." diff --git a/tests/import-utils.scm b/tests/import-utils.scm index 607349203c..27bd87940a 100644 --- a/tests/import-utils.scm +++ b/tests/import-utils.scm @@ -31,6 +31,16 @@ (define-module (test-import-utils) (test-begin "import-utils") +(test-equal "beautify-description: empty string" + "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information." + (beautify-description "")) + +(test-equal "beautify-description: not a string" + "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information." + (beautify-description '())) + (test-equal "beautify-description: use double spacing" "\ Trust me Mr. Hendrix, M. Night Shyamalan et al. \ base-commit: 3a8c20408f0078a580d27f74bc69b5a1069a003b -- 2.47.1 ------------=_1744705506-27834-1--
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.