1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

lint: Fix regressions in tests.

This fixes a regression introduced with commit 7752580a33 ("guix: lint: Check
end of sentences for a period.").

* guix/lint.scm (check-description-style): Do not emit warning when the
description is empty or ends with trailing whitespace.
* tests/lint.scm ("description: invalid Texinfo markup")
("description: may start with texinfo markup")
("description: may not contain trademark signs: ™")
("description: may not contain trademark signs: ®"): Add period.

Fixes: #4222
Change-Id: Ib10bcf324cb55b39a88c0c67875a40a59c1d4c18
This commit is contained in:
Maxim Cournoyer
2025-11-14 16:39:43 +09:00
parent 3fa51e04f8
commit 4932444387
2 changed files with 7 additions and 5 deletions

View File

@@ -398,7 +398,9 @@ superfluous when building natively and incorrect when cross-compiling."
(define (check-ends-with-period description) (define (check-ends-with-period description)
"Checks that a description field ends with a period." "Checks that a description field ends with a period."
(if (not (string-suffix? "." description)) (if (not (or (string-null? description) ;check-not-empty
(string-suffix? " " description) ;check-no-trailing-whitespace
(string-suffix? "." description)))
(list (list
(make-warning package (make-warning package
(G_ "description should end with a period") (G_ "description should end with a period")

View File

@@ -119,7 +119,7 @@
"Texinfo markup in description is invalid" "Texinfo markup in description is invalid"
(single-lint-warning-message (single-lint-warning-message
(check-description-style (check-description-style
(dummy-package "x" (description (identity "f{oo}b@r")))))) (dummy-package "x" (description (identity "f{oo}b@r."))))))
(test-equal "description: does not start with an upper-case letter" (test-equal "description: does not start with an upper-case letter"
"description should start with an upper-case letter or digit" "description should start with an upper-case letter or digit"
@@ -131,7 +131,7 @@
(test-equal "description: may start with texinfo markup" (test-equal "description: may start with texinfo markup"
'() '()
(check-description-style (check-description-style
(dummy-package "x" (description "@emph{Maxwell Equations of Software}")))) (dummy-package "x" (description "@emph{Maxwell Equations of Software}."))))
(test-equal "description: may start with a digit" (test-equal "description: may start with a digit"
'() '()
@@ -187,14 +187,14 @@
"description should not contain trademark sign '™' at 20" "description should not contain trademark sign '™' at 20"
(single-lint-warning-message (single-lint-warning-message
(let ((pkg (dummy-package "x" (let ((pkg (dummy-package "x"
(description "Does The Right Thing™")))) (description "Does The Right Thing™."))))
(check-description-style pkg)))) (check-description-style pkg))))
(test-equal "description: may not contain trademark signs: ®" (test-equal "description: may not contain trademark signs: ®"
"description should not contain trademark sign '®' at 17" "description should not contain trademark sign '®' at 17"
(single-lint-warning-message (single-lint-warning-message
(let ((pkg (dummy-package "x" (let ((pkg (dummy-package "x"
(description "Works with Format®")))) (description "Works with Format®."))))
(check-description-style pkg)))) (check-description-style pkg))))
(test-equal "description: suggest ornament instead of quotes" (test-equal "description: suggest ornament instead of quotes"