mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 12:05:19 -06:00
lint: Prevent false positives in description typo check.
* guix/lint.scm(check-description-style)[check-description-typo]: Add spaces to match strings to prevent matching false positives, like "allows tokens" or "prevents torpedoes". * tests/lint.scm: Add test. Change-Id: Ifc2ec6167a590b9d2e742dd86fecd798c4bfaa24 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
687f4e22e6
commit
27b4c319c0
2 changed files with 9 additions and 3 deletions
|
|
@ -507,8 +507,8 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
|
|||
(check-trademarks description)
|
||||
(check-description-typo description '(("This packages" . "This package")
|
||||
("This modules" . "This module")
|
||||
("allows to" . #f)
|
||||
("permits to" . #f)))
|
||||
("allows to " . #f)
|
||||
("permits to " . #f)))
|
||||
;; Use raw description for this because Texinfo rendering
|
||||
;; automatically fixes end of sentence space.
|
||||
(check-end-of-sentence-space description)
|
||||
|
|
|
|||
|
|
@ -219,12 +219,18 @@
|
|||
(check-description-style pkg))))
|
||||
|
||||
(test-equal "description: grammar 'allows to'"
|
||||
"description contains typo 'allows to'"
|
||||
"description contains typo 'allows to '"
|
||||
(single-lint-warning-message
|
||||
(let ((pkg (dummy-package "x"
|
||||
(description "This package allows to do stuff."))))
|
||||
(check-description-style pkg))))
|
||||
|
||||
(test-equal "description: grammar 'allows to' 2"
|
||||
'()
|
||||
(let ((pkg (dummy-package "x"
|
||||
(description "This package allows tokenization."))))
|
||||
(check-description-style pkg)))
|
||||
|
||||
(test-equal "synopsis: not a string"
|
||||
"invalid synopsis: #f"
|
||||
(single-lint-warning-message
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue