aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts/lint.scm
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2017-03-20 13:41:41 +0300
committerAlex Kost <alezost@gmail.com>2017-03-27 10:55:16 +0300
commit689db38e3467f66725e8841eac72225110a75a17 (patch)
tree1b357ea14f3761f7d4c361c1204815cd99d4df54 /guix/scripts/lint.scm
parent2fccc0d193497eb2ee3127270dea12be103f1bc2 (diff)
downloadgnu-guix-689db38e3467f66725e8841eac72225110a75a17.tar
gnu-guix-689db38e3467f66725e8841eac72225110a75a17.tar.gz
ui: Support Texinfo markup in package synopses.
* guix/ui.scm (package-field-string): New procedure. (package-description-string): Use it. (package-synopsis-string): New procedure. (package->recutils): Use it. * guix/scripts/lint.scm (check-synopsis-style)[check-texinfo-markup]: New procedure. Use it in checks. * tests/lint.scm: Test it. * gnu/packages/perl.scm (perl-try-tiny)[synopsis]: Adjust for the Texinfo markup.
Diffstat (limited to 'guix/scripts/lint.scm')
-rw-r--r--guix/scripts/lint.scm22
1 files changed, 19 insertions, 3 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 66c82f0409..811f167067 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -347,10 +348,25 @@ the synopsis")
(_ "synopsis should not start with the package name")
'synopsis)))
+ (define (check-texinfo-markup synopsis)
+ "Check that SYNOPSIS can be parsed as a Texinfo fragment. If the
+markup is valid return a plain-text version of SYNOPSIS, otherwise #f."
+ (catch #t
+ (lambda () (texi->plain-text synopsis))
+ (lambda (keys . args)
+ (emit-warning package
+ (_ "Texinfo markup in synopsis is invalid")
+ 'synopsis)
+ #f)))
+
(define checks
- (list check-not-empty check-proper-start check-final-period
- check-start-article check-start-with-package-name
- check-synopsis-length))
+ (list check-not-empty
+ check-proper-start
+ check-final-period
+ check-start-article
+ check-start-with-package-name
+ check-synopsis-length
+ check-texinfo-markup))
(match (package-synopsis package)
((? string? synopsis)