summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2014-10-22 13:48:55 -0500
committerEric Bavier <bavier@member.fsf.org>2014-10-26 13:03:53 -0500
commit334c43e35462f20d75f25a05e5b66095839d81c0 (patch)
tree2fed9865cad54bf5228d209e1c5008dd5f4402a8 /guix
parent574e847b8ea692aeea051d487cc95cec1257aba7 (diff)
downloadgnu-guix-334c43e35462f20d75f25a05e5b66095839d81c0.tar
gnu-guix-334c43e35462f20d75f25a05e5b66095839d81c0.tar.gz
guix: lint: Check for empty synopses and descriptions.
* guix/scripts/lint.scm (check-description-style, check-synopsis-style): New emptiness checks. * tests/lint.scm: Test them.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/lint.scm14
1 files changed, 14 insertions, 0 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 7b530fa5ac..5f1675f83f 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -82,6 +82,12 @@
(define (check-description-style package)
;; Emit a warning if stylistic issues are found in the description of PACKAGE.
+ (define (check-not-empty description)
+ (when (string-null? description)
+ (emit-warning package
+ "description should not be empty"
+ 'description)))
+
(define (check-starts-with-upper-case description)
(unless (start-with-capital-letter? description)
(emit-warning package
@@ -110,6 +116,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}"
(let ((description (package-description package)))
(when (string? description)
(begin
+ (check-not-empty description)
(check-starts-with-upper-case description)
(check-end-of-sentence-space description)))))
@@ -128,6 +135,12 @@ by two spaces; possible infraction~p at ~{~a~^, ~}"
(define (check-synopsis-style package)
;; Emit a warning if stylistic issues are found in the synopsis of PACKAGE.
+ (define (check-not-empty synopsis)
+ (when (string-null? synopsis)
+ (emit-warning package
+ "synopsis should not be empty"
+ 'synopsis)))
+
(define (check-final-period synopsis)
;; Synopsis should not end with a period, except for some special cases.
(when (and (string-suffix? "." synopsis)
@@ -164,6 +177,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}"
(let ((synopsis (package-synopsis package)))
(begin
+ (check-not-empty synopsis)
(check-synopsis-start-upper-case synopsis)
(check-final-period synopsis)
(check-start-article synopsis)