aboutsummaryrefslogtreecommitdiff
path: root/guix/lint.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2021-10-31 12:47:14 +0200
committerEfraim Flashner <efraim@flashner.co.il>2021-10-31 14:49:47 +0200
commitbc5155b952ae8bdbc56aded4d8d39768b4e2a7d4 (patch)
tree6b55475d86c522543384dea7d1ab66bba32af63e /guix/lint.scm
parentdac8d013bd1fc7f57b8ba3582eef6e0e01b23dfd (diff)
parent4e5000114ec01b5e92a87c52f2a10f9ba7a601c8 (diff)
downloadguix-bc5155b952ae8bdbc56aded4d8d39768b4e2a7d4.tar
guix-bc5155b952ae8bdbc56aded4d8d39768b4e2a7d4.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates-frozen
Diffstat (limited to 'guix/lint.scm')
-rw-r--r--guix/lint.scm19
1 files changed, 19 insertions, 0 deletions
diff --git a/guix/lint.scm b/guix/lint.scm
index 5edb9dea28..8bbbe210d6 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -322,6 +322,21 @@ markup is valid return a plain-text version of DESCRIPTION, otherwise #f."
(G_ "Texinfo markup in description is invalid")
#:field 'description))))
+ (define (check-description-typo description typo-corrections)
+ "Check that DESCRIPTION does not contain typo, with optional correction"
+ (append-map
+ (match-lambda
+ ((typo . correction)
+ (if (string-contains description typo)
+ (list
+ (make-warning package
+ (G_
+ (format #false
+ "description contains typo '~a'~@[, should be '~a'~]"
+ typo correction))))
+ '())))
+ typo-corrections))
+
(define (check-trademarks description)
"Check that DESCRIPTION does not contain '™' or '®' characters. See
http://www.gnu.org/prep/standards/html_node/Trademarks.html."
@@ -402,6 +417,10 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
(check-not-empty description)
(check-quotes description)
(check-trademarks description)
+ (check-description-typo description '(("This packages" . "This package")
+ ("This modules" . "This module")
+ ("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)