summaryrefslogtreecommitdiff
path: root/guix/scripts/lint.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2016-10-19 10:54:36 -0400
committerMark H Weaver <mhw@netris.org>2016-10-19 10:54:36 -0400
commitd2478b4cdd6f1db44f4725b39489aca89d3d9180 (patch)
treebc4714453fd9b7a2e64fcd5f58c24d371dbb91d8 /guix/scripts/lint.scm
parentc9a71c6fdab6914dd648b76c349c3af9018cad35 (diff)
parent152ffe7cb6ba02915d8645102e0f6dfeb639090d (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/scripts/lint.scm')
-rw-r--r--guix/scripts/lint.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index b3ec6d628e..d6281eae64 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -142,6 +142,10 @@ monad."
"Return #t if S starts with what looks like an abbreviation or acronym."
(string-match "^[A-Z][A-Z0-9]+\\>" s))
+(define %quoted-identifier-rx
+ ;; A quoted identifier, like 'this'.
+ (make-regexp "['`][[:graph:]]+'"))
+
(define (check-description-style package)
;; Emit a warning if stylistic issues are found in the description of PACKAGE.
(define (check-not-empty description)
@@ -173,6 +177,16 @@ trademark sign '~a' at ~d")
'description))
(else #t)))
+ (define (check-quotes description)
+ "Check whether DESCRIPTION contains single quotes and suggest @code."
+ (when (regexp-exec %quoted-identifier-rx description)
+ (emit-warning package
+
+ ;; TRANSLATORS: '@code' is Texinfo markup and must be kept
+ ;; as is.
+ (_ "use @code or similar ornament instead of quotes")
+ 'description)))
+
(define (check-proper-start description)
(unless (or (properly-starts-sentence? description)
(string-prefix-ci? (package-name package) description))
@@ -203,6 +217,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
(if (string? description)
(begin
(check-not-empty description)
+ (check-quotes description)
(check-trademarks description)
;; Use raw description for this because Texinfo rendering
;; automatically fixes end of sentence space.