"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)
'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))
(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.
(check-description-style pkg)))
"should not contain trademark sign"))))
+(test-assert "description: suggest ornament instead of quotes"
+ (->bool
+ (string-contains (with-warnings
+ (let ((pkg (dummy-package "x"
+ (description "This is a 'quoted' thing."))))
+ (check-description-style pkg)))
+ "use @code")))
+
(test-assert "synopsis: not a string"
(->bool
(string-contains (with-warnings