diff options
author | Eric Bavier <bavier@member.fsf.org> | 2016-08-23 02:08:02 -0500 |
---|---|---|
committer | Eric Bavier <bavier@member.fsf.org> | 2016-08-28 23:24:18 -0500 |
commit | 83f18e06530f025df9f6c5059bfe261a1291a24f (patch) | |
tree | 7bcb3fb124a57a878d5b729ae6e47cea05f5ed93 /guix | |
parent | 334bda9a9e01b73b772b3f30b04abea35e5391f8 (diff) | |
download | gnu-guix-83f18e06530f025df9f6c5059bfe261a1291a24f.tar gnu-guix-83f18e06530f025df9f6c5059bfe261a1291a24f.tar.gz |
guix: lint: Check descriptions for trademark signs.
* guix/scripts/lint.scm (check-description-style): Emit a warning if
trademark signs found in description.
* tests/lint.scm (description: may not contain trademark signs): Add
test.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/scripts/lint.scm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index 51191e7e7b..eac3214bbf 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -161,6 +161,18 @@ markup is valid return a plain-text version of DESCRIPTION, otherwise #f." 'description) #f))) + (define (check-trademarks description) + "Check that DESCRIPTION does not contain '™' or '®' characters. See +http://www.gnu.org/prep/standards/html_node/Trademarks.html." + (match (string-index description (char-set #\™ #\®)) + ((and (? number?) index) + (emit-warning package + (format #f (_ "description should not contain ~ +trademark sign '~a' at ~d") + (string-ref description index) index) + 'description)) + (else #t))) + (define (check-proper-start description) (unless (or (properly-starts-sentence? description) (string-prefix-ci? (package-name package) description)) @@ -191,6 +203,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}") (if (string? description) (begin (check-not-empty description) + (check-trademarks description) ;; Use raw description for this because Texinfo rendering ;; automatically fixes end of sentence space. (check-end-of-sentence-space description) |