all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mathieu Lirzin <mthl@openmailbox.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH 1/2] lint: Check non-translated package descriptions.
Date: Fri, 25 Sep 2015 01:04:22 +0200	[thread overview]
Message-ID: <87oagrxvux.fsf@openmailbox.org> (raw)
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")

[-- Attachment #1: Type: text/plain, Size: 343 bytes --]

ludo@gnu.org (Ludovic Courtès) writes:

> Mathieu Lirzin <mthl@openmailbox.org> 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...


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lint-Fix-missing-warning-symbol.patch --]
[-- Type: text/x-diff, Size: 1358 bytes --]

From 76f98cfc1567450913394ca871ebce40c8ed70e2 Mon Sep 17 00:00:00 2001
From: Mathieu Lirzin <mthl@openmailbox.org>
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


[-- Attachment #3: Type: text/plain, Size: 294 bytes --]


Usage of ‘false-if-exception’ made me realize that ‘emit-warning’ is not
nicely composable.  What about making it return ‘#f’ in order to compose
checks and warning together as boolean expressions?  Is that idiomatic?
Maybe you have a better suggestion?

--
Mathieu Lirzin

  reply	other threads:[~2015-09-24 23:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 13:44 [PATCH 0/2] lint: Texinfo again Mathieu Lirzin
2015-09-22 13:44 ` [PATCH 1/2] lint: Check non-translated package descriptions Mathieu Lirzin
2015-09-22 21:36   ` Ludovic Courtès
2015-09-24 23:04     ` Mathieu Lirzin [this message]
2015-09-25 16:17       ` Ludovic Courtès
2015-09-25 21:26         ` Mathieu Lirzin
2015-09-26 13:05           ` Ludovic Courtès
2015-09-26 17:09             ` Mathieu Lirzin
2015-09-27 20:22               ` Ludovic Courtès
2015-09-22 13:44 ` [PATCH 2/2] lint: Accept '`' character Mathieu Lirzin
2015-09-22 21:37   ` Ludovic Courtès

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=87oagrxvux.fsf@openmailbox.org \
    --to=mthl@openmailbox.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /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.