aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@openmailbox.org>2015-09-15 17:38:56 +0200
committerMathieu Lirzin <mthl@openmailbox.org>2015-09-15 19:01:23 +0200
commit3500e659f114e0e8213f2b8340128f66251bd7b4 (patch)
tree56e7c515448a189cc60ba9e6f979bd405e01d1a4 /guix
parent83d95c7b3686a57f5c871372051203a1b2182d99 (diff)
downloadgnu-guix-3500e659f114e0e8213f2b8340128f66251bd7b4.tar
gnu-guix-3500e659f114e0e8213f2b8340128f66251bd7b4.tar.gz
lint: Add 'check-texinfo-markup' checker.
* guix/script/lint.scm (check-description-style): Check for invalid Texinfo markup. * tests/lint.scm: Test it.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/lint.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index ab7d7c67dc..71f582afe7 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2014 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -141,6 +142,13 @@ monad."
(_ "description should not be empty")
'description)))
+ (define (check-texinfo-markup package)
+ "Check that PACKAGE description can be parsed as a Texinfo fragment."
+ (catch 'parser-error
+ (lambda () (package-description-string package))
+ (lambda (keys . args)
+ (emit-warning package (_ "Texinfo markup in description is invalid")))))
+
(define (check-proper-start description)
(unless (or (properly-starts-sentence? description)
(string-prefix-ci? (package-name package) description))
@@ -170,6 +178,7 @@ 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))))