GNU bug report logs - #49133
[PATCH] lint: Check for leading whitespace in description.

Previous Next

Package: guix-patches;

Reported by: Brice Waegeneire <brice <at> waegenei.re>

Date: Sun, 20 Jun 2021 13:35:02 UTC

Severity: normal

Tags: patch

Done: Brice Waegeneire <brice <at> waegenei.re>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49133 in the body.
You can then email your comments to 49133 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#49133; Package guix-patches. (Sun, 20 Jun 2021 13:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brice Waegeneire <brice <at> waegenei.re>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 20 Jun 2021 13:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: guix-patches <at> gnu.org
Subject: [PATCH] lint: Check for leading whitespace in description.
Date: Sun, 20 Jun 2021 15:34:19 +0200
* 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 <samplet <at> ngyro.com>
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
+;;; Copyright © 2021 Brice Waegeneire <brice <at> waegenei.re>
 ;;;
 ;;; 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





Information forwarded to guix-patches <at> gnu.org:
bug#49133; Package guix-patches. (Thu, 08 Jul 2021 14:11:02 GMT) Full text and rfc822 format available.

Message #8 received at 49133 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 49133 <at> debbugs.gnu.org
Subject: Re: bug#49133: [PATCH] lint: Check for leading whitespace in
 description.
Date: Thu, 08 Jul 2021 16:10:47 +0200
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




Reply sent to Brice Waegeneire <brice <at> waegenei.re>:
You have taken responsibility. (Tue, 13 Jul 2021 05:27:01 GMT) Full text and rfc822 format available.

Notification sent to Brice Waegeneire <brice <at> waegenei.re>:
bug acknowledged by developer. (Tue, 13 Jul 2021 05:27:02 GMT) Full text and rfc822 format available.

Message #13 received at 49133-done <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 49133-done <at> debbugs.gnu.org
Subject: Re: bug#49133: [PATCH] lint: Check for leading whitespace in
 description.
Date: Tue, 13 Jul 2021 07:26:28 +0200
Mathieu Othacehe <othacehe <at> gnu.org> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 10 Aug 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 260 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.