summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjgart <jgart@dismail.de>2025-11-01 13:48:50 -0500
committerjgart <jgart@dismail.de>2025-11-05 10:25:01 -0600
commit7752580a33f416119d5ee2e9c553c8578a8ca23f (patch)
treebe7e99063d484bf3f4fa30224f0a279e7b0cd64b
parente49aa0f3a79eadf0f03417699fce48e68e1899c3 (diff)
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>
-rw-r--r--guix/lint.scm10
-rw-r--r--tests/lint.scm7
2 files changed, 17 insertions, 0 deletions
diff --git a/guix/lint.scm b/guix/lint.scm
index 146bc337d7b..ad639a63f75 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -396,6 +396,15 @@ superfluous when building natively and incorrect when cross-compiling."
396 #:field 'description)) 396 #:field 'description))
397 '())) 397 '()))
398 398
399 (define (check-ends-with-period description)
400 "Checks that a description field ends with a period."
401 (if (not (string-suffix? "." description))
402 (list
403 (make-warning package
404 (G_ "description should end with a period")
405 #:field 'description))
406 '()))
407
399 (define (check-texinfo-markup description) 408 (define (check-texinfo-markup description)
400 "Check that DESCRIPTION can be parsed as a Texinfo fragment. If the 409 "Check that DESCRIPTION can be parsed as a Texinfo fragment. If the
401markup is valid return a plain-text version of DESCRIPTION, otherwise #f." 410markup is valid return a plain-text version of DESCRIPTION, otherwise #f."
@@ -515,6 +524,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
515 (check-not-empty description) 524 (check-not-empty description)
516 (check-quotes description) 525 (check-quotes description)
517 (check-trademarks description) 526 (check-trademarks description)
527 (check-ends-with-period description)
518 (check-description-typo description 528 (check-description-typo description
519 '(("Infrastucture" . "Infrastructure") ; codespell:ignore 529 '(("Infrastucture" . "Infrastructure") ; codespell:ignore
520 ("This packages" . "This package") ; codespell:ignore 530 ("This packages" . "This package") ; codespell:ignore
diff --git a/tests/lint.scm b/tests/lint.scm
index 652a55db922..f712c38c3fd 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -108,6 +108,13 @@
108 (check-description-style 108 (check-description-style
109 (dummy-package "x" (description ""))))) 109 (dummy-package "x" (description "")))))
110 110
111(test-equal "description: does not end with a period"
112 "description should end with a period"
113 (single-lint-warning-message
114 (let ((pkg (dummy-package "x"
115 (description "This package provides a bad description"))))
116 (check-description-style pkg))))
117
111(test-equal "description: invalid Texinfo markup" 118(test-equal "description: invalid Texinfo markup"
112 "Texinfo markup in description is invalid" 119 "Texinfo markup in description is invalid"
113 (single-lint-warning-message 120 (single-lint-warning-message