mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
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:
@@ -396,6 +396,15 @@ superfluous when building natively and incorrect when cross-compiling."
|
|||||||
#:field 'description))
|
#: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)
|
(define (check-texinfo-markup description)
|
||||||
"Check that DESCRIPTION can be parsed as a Texinfo fragment. If the
|
"Check that DESCRIPTION can be parsed as a Texinfo fragment. If the
|
||||||
markup is valid return a plain-text version of DESCRIPTION, otherwise #f."
|
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-not-empty description)
|
||||||
(check-quotes description)
|
(check-quotes description)
|
||||||
(check-trademarks description)
|
(check-trademarks description)
|
||||||
|
(check-ends-with-period description)
|
||||||
(check-description-typo description
|
(check-description-typo description
|
||||||
'(("Infrastucture" . "Infrastructure") ; codespell:ignore
|
'(("Infrastucture" . "Infrastructure") ; codespell:ignore
|
||||||
("This packages" . "This package") ; codespell:ignore
|
("This packages" . "This package") ; codespell:ignore
|
||||||
|
|||||||
@@ -108,6 +108,13 @@
|
|||||||
(check-description-style
|
(check-description-style
|
||||||
(dummy-package "x" (description "")))))
|
(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"
|
(test-equal "description: invalid Texinfo markup"
|
||||||
"Texinfo markup in description is invalid"
|
"Texinfo markup in description is invalid"
|
||||||
(single-lint-warning-message
|
(single-lint-warning-message
|
||||||
|
|||||||
Reference in New Issue
Block a user