From: Eric Bavier <ericbavier@openmailbox.org>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: guix-devel@gnu.org, John Darrington <jmd@gnu.org>
Subject: Re: [PATCH] gnu: Remove trademark acknowledgements.
Date: Tue, 23 Aug 2016 10:31:09 -0500 [thread overview]
Message-ID: <20160823103109.5b28fafd@openmailbox.org> (raw)
In-Reply-To: <871t1fzt8q.fsf@elephly.net>
[-- Attachment #1: Type: text/plain, Size: 976 bytes --]
On Tue, 23 Aug 2016 12:15:17 +0200
Ricardo Wurmus <rekado@elephly.net> wrote:
> 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”?
In this updated patch I addressed both of these concerns. It's also
about 14% faster (on a single benchmark :).
`~Eric
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-guix-lint-Check-descriptions-for-trademark-signs.patch --]
[-- Type: text/x-patch, Size: 1811 bytes --]
From 46a8f3322392fcd6a7641062ff6b3d23685f394b Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
Date: Tue, 23 Aug 2016 02:08:02 -0500
Subject: [PATCH] guix: lint: Check descriptions for trademark signs.
* guix/scripts/lint.scm (check-description-style): Emit a warning if
trademark signs found in description.
---
guix/scripts/lint.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 51191e7..07e46a9 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -161,6 +161,17 @@ 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)))
+ (else #t)))
+
(define (check-proper-start description)
(unless (or (properly-starts-sentence? description)
(string-prefix-ci? (package-name package) description))
@@ -191,6 +202,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
next prev parent reply other threads:[~2016-08-23 15:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-22 18:24 [PATCH] gnu: Remove trademark acknowledgements John Darrington
2016-08-22 18:28 ` John Darrington
2016-08-22 20:03 ` Ricardo Wurmus
2016-08-23 7:11 ` Eric Bavier
2016-08-23 10:15 ` Ricardo Wurmus
2016-08-23 15:31 ` Eric Bavier [this message]
2016-08-27 22:24 ` Ludovic Courtès
2016-08-29 4:25 ` Eric Bavier
2016-08-22 19:30 ` Leo Famulari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160823103109.5b28fafd@openmailbox.org \
--to=ericbavier@openmailbox.org \
--cc=guix-devel@gnu.org \
--cc=jmd@gnu.org \
--cc=rekado@elephly.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.