@@ -278,6 +278,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
@@ -287,6 +296,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)
(match (check-texinfo-markup description)
((and warning (? lint-warning?)) (list warning))
(plain-description
@@ -160,6 +160,13 @@
(description "This is a 'quoted' thing."))))
(check-description-style pkg))))
+(test-equal "description: trailing whitespace"
+ "description contains trailing whitespace"
+ (single-lint-warning-message
+ (let ((pkgs (dummy-package "x"
+ (description "Whitespace. "))))
+ (check-description-style pkg))))
+
(test-equal "synopsis: not a string"
"invalid synopsis: #f"
(single-lint-warning-message