From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: Re: [PATCH] gnu: Remove trademark acknowledgements. Date: Tue, 23 Aug 2016 10:31:09 -0500 Message-ID: <20160823103109.5b28fafd@openmailbox.org> References: <1471890295-25249-1-git-send-email-jmd@gnu.org> <20160822182821.GA25307@jocasta.intra> <87k2f8zi35.fsf@elephly.net> <20160823021114.29aab55a@openmailbox.org> <871t1fzt8q.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/k.hJoZC2JVvdCAcftE7fuFf" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcDfl-0004N1-SP for guix-devel@gnu.org; Tue, 23 Aug 2016 11:31:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcDfi-00047f-3X for guix-devel@gnu.org; Tue, 23 Aug 2016 11:31:29 -0400 In-Reply-To: <871t1fzt8q.fsf@elephly.net> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel@gnu.org, John Darrington --MP_/k.hJoZC2JVvdCAcftE7fuFf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tue, 23 Aug 2016 12:15:17 +0200 Ricardo Wurmus wrote: > Eric Bavier writes: >=20 > > On Mon, 22 Aug 2016 22:03:58 +0200 > > Ricardo Wurmus wrote: > > =20 > >> John Darrington writes: > >> =20 > >> > These somehow crept in, but are an explicit violation of GNU policy = and > >> > coding standards. =20 > >>=20 > >> Good catch! Thanks for fixing this. > >>=20 > >> ~~ Ricardo =20 > > > > How about the attached patch to catch such things earlier? =20 >=20 > I like it. Thanks, Eric! >=20 > Not sure if we should use =E2=80=9Cfor-each=E2=80=9D here (going through = the string > once for each character) or if we could just go through the string once, > checking for any character match. >=20 > Also, should we replace =E2=80=9Csign=E2=80=9D with =E2=80=9Ccharacter=E2= =80=9D? In this updated patch I addressed both of these concerns. It's also about 14% faster (on a single benchmark :). `~Eric --MP_/k.hJoZC2JVvdCAcftE7fuFf Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-guix-lint-Check-descriptions-for-trademark-signs.patch =46rom 46a8f3322392fcd6a7641062ff6b3d23685f394b Mon Sep 17 00:00:00 2001 From: Eric Bavier 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 DESCRIP= TION, otherwise #f." 'description) #f))) =20 + (define (check-trademarks description) + "Check that DESCRIPTION does not contain '=E2=84=A2' or '=C2=AE' chara= cters. See +http://www.gnu.org/prep/standards/html_node/Trademarks.html." + (match (string-index description (char-set #\=E2=84=A2 #\=C2=AE)) + ((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) --=20 2.9.2 --MP_/k.hJoZC2JVvdCAcftE7fuFf--