From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Lirzin Subject: Re: [PATCH 1/2] lint: Check non-translated package descriptions. Date: Fri, 25 Sep 2015 01:04:22 +0200 Message-ID: <87oagrxvux.fsf@openmailbox.org> References: <1442929463-19527-1-git-send-email-mthl@openmailbox.org> <1442929463-19527-2-git-send-email-mthl@openmailbox.org> <87wpvii1at.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfFac-00041n-Ej for guix-devel@gnu.org; Thu, 24 Sep 2015 19:06:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfFaY-0002Sx-0H for guix-devel@gnu.org; Thu, 24 Sep 2015 19:06:10 -0400 Received: from smtp10.openmailbox.org ([62.4.1.44]:52976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfFaX-0002Sk-NM for guix-devel@gnu.org; Thu, 24 Sep 2015 19:06:05 -0400 In-Reply-To: <87wpvii1at.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 22 Sep 2015 23:36:42 +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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Mathieu Lirzin skribis: > >> * guix/ui.scm (texi->plain-text): Export. >> * guix/scripts/lint.scm (check-description-style): Use it instead of >> 'package-description-string'. > > [...] After pushing it, I discovered one mistake here is the patch fixing it... --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-lint-Fix-missing-warning-symbol.patch >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. --- guix/scripts/lint.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 invalid")) - #f))) + (unless (false-if-exception (texi->plain-text description)) + (emit-warning package + (_ "Texinfo markup in description is invalid") + 'description) + #f)) (define (check-proper-start description) (unless (or (properly-starts-sentence? description) -- 2.5.3 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 ord= er to compose checks and warning together as boolean expressions? Is that idiomatic? Maybe you have a better suggestion? -- Mathieu Lirzin --=-=-=--