From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/2] lint: Check non-translated package descriptions. Date: Fri, 25 Sep 2015 18:17:40 +0200 Message-ID: <87oagqv5gb.fsf@gnu.org> References: <1442929463-19527-1-git-send-email-mthl@openmailbox.org> <1442929463-19527-2-git-send-email-mthl@openmailbox.org> <87wpvii1at.fsf@gnu.org> <87oagrxvux.fsf@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfVgv-00063S-A2 for guix-devel@gnu.org; Fri, 25 Sep 2015 12:17:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfVgu-0007gJ-4x for guix-devel@gnu.org; Fri, 25 Sep 2015 12:17:45 -0400 In-Reply-To: <87oagrxvux.fsf@openmailbox.org> (Mathieu Lirzin's message of "Fri, 25 Sep 2015 01:04:22 +0200") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mathieu Lirzin Cc: guix-devel@gnu.org Mathieu Lirzin skribis: > From 76f98cfc1567450913394ca871ebce40c8ed70e2 Mon Sep 17 00:00:00 2001 > From: Mathieu Lirzin > Date: Fri, 25 Sep 2015 00:37:36 +0200 > Subject: [PATCH] lint: Fix missing warning symbol. > > * guix/scripts/lint.scm (check-description-style): Set 'field' parameter > when emitting a warning in 'check-texinfo-markup'. This is a followup > to commit 2748ee3. This is only one part of what the patch does. > diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm > index b0427f7..0adb3bf 100644 > --- a/guix/scripts/lint.scm > +++ b/guix/scripts/lint.scm > @@ -146,11 +146,11 @@ monad." > (define (check-texinfo-markup description) > "Check that DESCRIPTION can be parsed as a Texinfo fragment. If the > markup is valid return a plain-text version of DESCRIPTION, otherwise #f= ." > - (catch 'parser-error > - (lambda () (texi->plain-text description)) > - (lambda (keys . args) > - (emit-warning package (_ "Texinfo markup in description is inval= id")) > - #f))) > + (unless (false-if-exception (texi->plain-text description)) > + (emit-warning package > + (_ "Texinfo markup in description is invalid") > + 'description) > + #f)) In general, it=E2=80=99s best to avoid =E2=80=98false-if-exception=E2=80=99= because it=E2=80=99s too coarse-grain. Here it=E2=80=99s probably OK though, because we want to cat= ch any error that may occur in during the conversion. So this patch is OK (with appropriate commit log.) > Usage of =E2=80=98false-if-exception=E2=80=99 made me realize that =E2=80= =98emit-warning=E2=80=99 is not > nicely composable. What about making it return =E2=80=98#f=E2=80=99 in o= rder to compose > checks and warning together as boolean expressions? Is that idiomatic? > Maybe you have a better suggestion? Not sure I follow. Those =E2=80=98check=E2=80=99 procedures are only calle= d for effect, not for value, right? Thanks, Ludo=E2=80=99.