From 903581f971cd63e3079e849b171bdb8e8118141f Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sat, 25 Oct 2014 11:29:34 -0500 Subject: guix: lint: Allow digits at start of synopsis or description. * guix/scripts/lint.scm (start-with-capital-letter?): Rename too... (properly-starts-sentence?): Rewrite with regex and add digits. (check-description-style, check-synopsis-style): Use it. * tests/lint.scm: Add tests. --- tests/lint.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/lint.scm b/tests/lint.scm index b732a1826a..9557887e4f 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -63,6 +63,15 @@ (define (call-with-warnings thunk) (check-description-style pkg)))) "description should start with an upper-case letter"))) +(test-assert "description: may start with a digit" + (not + (string-contains (call-with-warnings + (lambda () + (let ((pkg (dummy-package "x" + (description "2-component library.")))) + (check-description-style pkg)))) + "description should start with an upper-case letter"))) + (test-assert "description: two spaces after end of sentence" (->bool (string-contains (call-with-warnings @@ -100,6 +109,15 @@ (define (call-with-warnings thunk) (check-synopsis-style pkg)))) "synopsis should start with an upper-case letter"))) +(test-assert "synopsis: may start with a digit" + (not + (string-contains (call-with-warnings + (lambda () + (let ((pkg (dummy-package "x" + (synopsis "5-dimensional frobnicator")))) + (check-synopsis-style pkg)))) + "synopsis should start with an upper-case letter"))) + (test-assert "synopsis: ends with a period" (->bool (string-contains (call-with-warnings -- cgit v1.2.3