all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mathieu Lirzin <mthl@openmailbox.org>
To: guix-devel@gnu.org
Subject: [PATCH 1/2] lint: Check non-translated package descriptions.
Date: Tue, 22 Sep 2015 15:44:22 +0200	[thread overview]
Message-ID: <1442929463-19527-2-git-send-email-mthl@openmailbox.org> (raw)
In-Reply-To: <1442929463-19527-1-git-send-email-mthl@openmailbox.org>

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


* guix/ui.scm (texi->plain-text): Export.
* guix/scripts/lint.scm (check-description-style): Use it instead of
  'package-description-string'.
---
 guix/scripts/lint.scm | 17 ++++++++++-------
 guix/ui.scm           |  1 +
 2 files changed, 11 insertions(+), 7 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lint-Check-non-translated-package-descriptions.patch --]
[-- Type: text/x-patch; name="0001-lint-Check-non-translated-package-descriptions.patch", Size: 2046 bytes --]

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 8224f54..a52a9eb 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -143,12 +143,14 @@ monad."
                     (_ "description should not be empty")
                     'description)))
 
-  (define (check-texinfo-markup package)
-    "Check that PACKAGE description can be parsed as a Texinfo fragment."
+  (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 () (package-description-string package))
+      (lambda () (texi->plain-text description))
       (lambda (keys . args)
-        (emit-warning package (_ "Texinfo markup in description is invalid")))))
+        (emit-warning package (_ "Texinfo markup in description is invalid"))
+        #f)))
 
   (define (check-proper-start description)
     (unless (or (properly-starts-sentence? description)
@@ -179,9 +181,10 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
   (let ((description (package-description package)))
     (when (string? description)
       (check-not-empty description)
-      (check-texinfo-markup package)
-      (check-proper-start description)
-      (check-end-of-sentence-space description))))
+      (and=> (check-texinfo-markup description)
+             (lambda (texi)
+               (check-proper-start texi)
+               (check-end-of-sentence-space texi))))))
 
 (define (check-inputs-should-be-native package)
   ;; Emit a warning if some inputs of PACKAGE are likely to belong to its
diff --git a/guix/ui.scm b/guix/ui.scm
index 4a3630f..055f2c2 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -75,6 +75,7 @@
             switch-symlinks
             config-directory
             fill-paragraph
+            texi->plain-text
             package-description-string
             string->recutils
             package->recutils

  reply	other threads:[~2015-09-22 13:46 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 ` Mathieu Lirzin [this message]
2015-09-22 21:36   ` [PATCH 1/2] lint: Check non-translated package descriptions Ludovic Courtès
2015-09-24 23:04     ` Mathieu Lirzin
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=1442929463-19527-2-git-send-email-mthl@openmailbox.org \
    --to=mthl@openmailbox.org \
    --cc=guix-devel@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.