summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorXinglu Chen <public@yoctocell.xyz>2021-05-30 22:30:32 +0200
committerLudovic Courtès <ludo@gnu.org>2021-06-08 23:28:04 +0200
commit93d85deae6bce16bc21fb42ad6a68a1bcbb72527 (patch)
treeac4db39ba881189c6a06f525ac826e7584465921 /guix
parent04afb76958184b2a6dafa2815a2a410424a05d84 (diff)
lint: Check for trailing whitespace in description.
* guix/lint.scm (check-description-style): Check for trailing whitespace. * tests/lint.scm: ("description: trailing whitespace"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'guix')
-rw-r--r--guix/lint.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/guix/lint.scm b/guix/lint.scm
index 1aba9eff68..8115f2aa50 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -300,6 +300,15 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
infractions)
#:field 'description)))))
+ (define (check-no-trailing-whitespace description)
+ "Check that DESCRIPTION doesn't have trailing whitespace."
+ (if (string-suffix? " " description)
+ (list
+ (make-warning package
+ (G_ "description contains trailing whitespace")
+ #:field 'description))
+ '()))
+
(let ((description (package-description package)))
(if (string? description)
(append
@@ -309,6 +318,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-trailing-whitespace description)
(match (check-texinfo-markup description)
((and warning (? lint-warning?)) (list warning))
(plain-description