From unknown Thu Jun 19 14:09:42 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#49133 <49133@debbugs.gnu.org> To: bug#49133 <49133@debbugs.gnu.org> Subject: Status: [PATCH] lint: Check for leading whitespace in description. Reply-To: bug#49133 <49133@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:09:42 +0000 retitle 49133 [PATCH] lint: Check for leading whitespace in description. reassign 49133 guix-patches submitter 49133 Brice Waegeneire severity 49133 normal tag 49133 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 20 09:34:31 2021 Received: (at submit) by debbugs.gnu.org; 20 Jun 2021 13:34:31 +0000 Received: from localhost ([127.0.0.1]:33248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1luxap-0004Ep-Hx for submit@debbugs.gnu.org; Sun, 20 Jun 2021 09:34:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:42570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1luxan-0004Eh-4x for submit@debbugs.gnu.org; Sun, 20 Jun 2021 09:34:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luxam-0003Fk-Ll for guix-patches@gnu.org; Sun, 20 Jun 2021 09:34:28 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:44247) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luxaj-0004wV-Md for guix-patches@gnu.org; Sun, 20 Jun 2021 09:34:28 -0400 Received: (Authenticated sender: brice@waegenei.re) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 8CB41240003 for ; Sun, 20 Jun 2021 13:34:21 +0000 (UTC) From: Brice Waegeneire To: guix-patches@gnu.org Subject: [PATCH] lint: Check for leading whitespace in description. Date: Sun, 20 Jun 2021 15:34:19 +0200 Message-Id: <20210620133419.15883-1-brice@waegenei.re> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=217.70.183.193; envelope-from=brice@waegenei.re; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) * guix/lint.scm (check-description-style): Check for leading whitespace. * tests/lint.scm: ("description: leading whitespace"): New test. --- guix/lint.scm | 11 +++++++++++ tests/lint.scm | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/guix/lint.scm b/guix/lint.scm index d65d5ce8f9..d18fcf920e 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2020 Timothy Sample ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -300,6 +301,15 @@ by two spaces; possible infraction~p at ~{~a~^, ~}") infractions) #:field 'description))))) + (define (check-no-leading-whitespace description) + "Check that DESCRIPTION doesn't have trailing whitespace." + (if (string-prefix? " " description) + (list + (make-warning package + (G_ "description contains leading whitespace") + #:field 'description)) + '())) + (define (check-no-trailing-whitespace description) "Check that DESCRIPTION doesn't have trailing whitespace." (if (string-suffix? " " description) @@ -318,6 +328,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}") ;; Use raw description for this because Texinfo rendering ;; automatically fixes end of sentence space. (check-end-of-sentence-space description) + (check-no-leading-whitespace description) (check-no-trailing-whitespace description) (match (check-texinfo-markup description) ((and warning (? lint-warning?)) (list warning)) diff --git a/tests/lint.scm b/tests/lint.scm index fae346e724..dd442f6af9 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -160,6 +160,13 @@ (description "This is a 'quoted' thing.")))) (check-description-style pkg)))) +(test-equal "description: leading whitespace" + "description contains leading whitespace" + (single-lint-warning-message + (let ((pkg (dummy-package "x" + (description " Whitespace.")))) + (check-description-style pkg)))) + (test-equal "description: trailing whitespace" "description contains trailing whitespace" (single-lint-warning-message -- 2.31.1 From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 08 10:10:56 2021 Received: (at 49133) by debbugs.gnu.org; 8 Jul 2021 14:10:56 +0000 Received: from localhost ([127.0.0.1]:57103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1Ujw-0000UM-4F for submit@debbugs.gnu.org; Thu, 08 Jul 2021 10:10:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1Uju-0000UA-MJ for 49133@debbugs.gnu.org; Thu, 08 Jul 2021 10:10:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38726) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1Ujp-0002M7-3U; Thu, 08 Jul 2021 10:10:49 -0400 Received: from [2a01:cb18:832e:5f00:3563:417e:2a38:86d8] (port=43496 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1Ujo-0006ph-Oi; Thu, 08 Jul 2021 10:10:48 -0400 From: Mathieu Othacehe To: Brice Waegeneire Subject: Re: bug#49133: [PATCH] lint: Check for leading whitespace in description. References: <20210620133419.15883-1-brice@waegenei.re> Date: Thu, 08 Jul 2021 16:10:47 +0200 In-Reply-To: <20210620133419.15883-1-brice@waegenei.re> (Brice Waegeneire's message of "Sun, 20 Jun 2021 15:34:19 +0200") Message-ID: <87fswox5eg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49133 Cc: 49133@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey Brice, > * guix/lint.scm (check-description-style): Check for leading whitespace. > * tests/lint.scm: ("description: leading whitespace"): New test. Looks fine, you can go ahead. Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 13 01:26:41 2021 Received: (at 49133-done) by debbugs.gnu.org; 13 Jul 2021 05:26:41 +0000 Received: from localhost ([127.0.0.1]:39166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3AwL-0005Ht-48 for submit@debbugs.gnu.org; Tue, 13 Jul 2021 01:26:41 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:44183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3AwI-0005Hh-Sl for 49133-done@debbugs.gnu.org; Tue, 13 Jul 2021 01:26:39 -0400 Received: (Authenticated sender: brice@waegenei.re) by relay12.mail.gandi.net (Postfix) with ESMTPSA id E9686200004; Tue, 13 Jul 2021 05:26:32 +0000 (UTC) From: Brice Waegeneire To: Mathieu Othacehe Subject: Re: bug#49133: [PATCH] lint: Check for leading whitespace in description. References: <20210620133419.15883-1-brice@waegenei.re> <87fswox5eg.fsf@gnu.org> Date: Tue, 13 Jul 2021 07:26:28 +0200 In-Reply-To: <87fswox5eg.fsf@gnu.org> (Mathieu Othacehe's message of "Thu, 08 Jul 2021 16:10:47 +0200") Message-ID: <87r1g2okcb.fsf_-_@waegenei.re> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49133-done Cc: 49133-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Mathieu Othacehe writes: >> * guix/lint.scm (check-description-style): Check for leading whitespace. >> * tests/lint.scm: ("description: leading whitespace"): New test. > > Looks fine, you can go ahead. Thanks, pushed as edb328ad83bf55e021018719d24f7c29adc43a96. From unknown Thu Jun 19 14:09:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 10 Aug 2021 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator