guix: lint: Check end of sentences for a period.

* guix/lint.scm (check-description-style): Check that sentences end with a period.

Change-Id: Ic10161f8093351dce440e19802a71f03bc849638
Signed-off-by: jgart <jgart@dismail.de>
This commit is contained in:
jgart 2025-11-01 13:48:50 -05:00
parent e49aa0f3a7
commit 7752580a33
No known key found for this signature in database
GPG key ID: A52AA2B477B6DD35
2 changed files with 17 additions and 0 deletions

View file

@ -396,6 +396,15 @@ superfluous when building natively and incorrect when cross-compiling."
#:field 'description))
'()))
(define (check-ends-with-period description)
"Checks that a description field ends with a period."
(if (not (string-suffix? "." description))
(list
(make-warning package
(G_ "description should end with a period")
#:field 'description))
'()))
(define (check-texinfo-markup description)
"Check that DESCRIPTION can be parsed as a Texinfo fragment. If the
markup is valid return a plain-text version of DESCRIPTION, otherwise #f."
@ -515,6 +524,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
(check-not-empty description)
(check-quotes description)
(check-trademarks description)
(check-ends-with-period description)
(check-description-typo description
'(("Infrastucture" . "Infrastructure") ; codespell:ignore
("This packages" . "This package") ; codespell:ignore

View file

@ -108,6 +108,13 @@
(check-description-style
(dummy-package "x" (description "")))))
(test-equal "description: does not end with a period"
"description should end with a period"
(single-lint-warning-message
(let ((pkg (dummy-package "x"
(description "This package provides a bad description"))))
(check-description-style pkg))))
(test-equal "description: invalid Texinfo markup"
"Texinfo markup in description is invalid"
(single-lint-warning-message