diff mbox

gnu: Remove trademark acknowledgements.

Message ID 20160823021114.29aab55a@openmailbox.org
State New
Headers show

Commit Message

Eric Bavier Aug. 23, 2016, 7:11 a.m. UTC
On Mon, 22 Aug 2016 22:03:58 +0200
Ricardo Wurmus <rekado@elephly.net> wrote:

> John Darrington <john@darrington.wattle.id.au> writes:
> 
> > These somehow crept in, but are an explicit violation of GNU policy and
> > coding standards.  
> 
> Good catch!  Thanks for fixing this.
> 
> ~~ Ricardo

How about the attached patch to catch such things earlier?

`~Eric

Comments

Ricardo Wurmus Aug. 23, 2016, 10:15 a.m. UTC | #1
Eric Bavier <ericbavier@openmailbox.org> writes:

> On Mon, 22 Aug 2016 22:03:58 +0200
> Ricardo Wurmus <rekado@elephly.net> wrote:
>
>> John Darrington <john@darrington.wattle.id.au> writes:
>> 
>> > These somehow crept in, but are an explicit violation of GNU policy and
>> > coding standards.  
>> 
>> Good catch!  Thanks for fixing this.
>> 
>> ~~ Ricardo
>
> How about the attached patch to catch such things earlier?

I like it.  Thanks, Eric!

Not sure if we should use “for-each” here (going through the string
once for each character) or if we could just go through the string once,
checking for any character match.

Also, should we replace “sign” with “character”?

~~ Ricardo
diff mbox

Patch

From d68b42ceff1993fa81c36f5187c9cfc12152bc1a Mon Sep 17 00:00:00 2001
From: Eric Bavier <ericbavier@openmailbox.org>
Date: Tue, 23 Aug 2016 02:08:02 -0500
Subject: [PATCH] guix: lint: Check descriptions for trademark signs.
To: guix-devel@gnu.org

From: Eric Bavier <bavier@member.fsf.org>

* guix/scripts/lint.scm (check-description-style): Emit a warning if
  trademark signs found in description.
---
 guix/scripts/lint.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 51191e7..98be4d8 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -161,6 +161,19 @@  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."
+    (for-each (lambda (sign)
+                (match (string-contains description sign)
+                  ((and (? number?) index)
+                   (emit-warning package
+                                 (format #f (_ "description should not contain ~
+trademark sign '~a' at ~d")
+                                         sign index)))
+                  (else #t)))
+              '("™" "®")))
+
   (define (check-proper-start description)
     (unless (or (properly-starts-sentence? description)
                 (string-prefix-ci? (package-name package) description))
@@ -191,6 +204,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)
-- 
2.9.2