summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--guix/scripts/lint.scm4
-rw-r--r--tests/lint.scm18
2 files changed, 20 insertions, 2 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 1124654d75..3f0a8d4fc0 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -148,8 +148,8 @@ Run a set of checkers on the specified package; if none is specified, run the ch
                       'synopsis)))
 
   (define (check-start-article synopsis)
-   (if (or (string=? (string-take synopsis 2) "A ")
-           (string=? (string-take synopsis 3) "An "))
+   (if (or (string-ci=? (string-take synopsis 2) "A ")
+           (string-ci=? (string-take synopsis 3) "An "))
        (emit-warning package
                      "no article allowed at the beginning of the synopsis"
                      'synopsis)))
diff --git a/tests/lint.scm b/tests/lint.scm
index ceb7abe23e..c439faa30e 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -97,6 +97,24 @@
                         (check-synopsis-style pkg))))
                     "no article allowed at the beginning of the synopsis")))
 
+(test-assert "synopsis: starts with 'a'"
+  (->bool
+   (string-contains (call-with-warnings
+                      (lambda ()
+                        (let ((pkg (dummy-package "x"
+                                     (synopsis "a bad synopsis"))))
+                        (check-synopsis-style pkg))))
+                    "no article allowed at the beginning of the synopsis")))
+
+(test-assert "synopsis: starts with 'an'"
+  (->bool
+   (string-contains (call-with-warnings
+                      (lambda ()
+                        (let ((pkg (dummy-package "x"
+                                     (synopsis "an awful synopsis"))))
+                        (check-synopsis-style pkg))))
+                    "no article allowed at the beginning of the synopsis")))
+
 (test-assert "synopsis: too long"
   (->bool
    (string-contains (call-with-warnings