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: Sat, 26 Sep 2015 15:05:28 +0200 Message-ID: <877fnd49gn.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> <87oagqv5gb.fsf@gnu.org> <874miikx6f.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]:42496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfpAV-0006AY-KM for guix-devel@gnu.org; Sat, 26 Sep 2015 09:05:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfpAR-00033H-UH for guix-devel@gnu.org; Sat, 26 Sep 2015 09:05:35 -0400 In-Reply-To: <874miikx6f.fsf@openmailbox.org> (Mathieu Lirzin's message of "Fri, 25 Sep 2015 23:26:32 +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: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Mathieu Lirzin skribis: >> >>> 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 t= he >>> 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 inv= alid")) >>> - #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 = catch >> any error that may occur in during the conversion. So this patch is OK >> (with appropriate commit log.) > > Ok, thanks for the explanation. > > > From 429ff285609120c4135eb64f1d6911924a24f5e6 Mon Sep 17 00:00:00 2001 > From: Mathieu Lirzin > Date: Fri, 25 Sep 2015 00:37:36 +0200 > Subject: [PATCH] lint: Improve 'check-texinfo-markup'. > > * guix/scripts/lint.scm (check-description-style): Set 'field' parameter > when emitting a warning in 'check-texinfo-markup'. Catch any error > that may occur in during the 'texi->plain-text' conversion. This is a > followup to commit 2748ee3. OK! Thanks, Ludo=E2=80=99.