mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
guix lint: Make sure a synopsis cannot start with a lower-case article.
* guix/scripts/lint.scm (check-start-article): use "string-ci=?" instead of "string=?". * tests/lint.scm ("synopsis: starts with 'a'", "synopsis: starts with 'an'"): New tests.
This commit is contained in:
parent
8202a51313
commit
a00ffdaa17
2 changed files with 20 additions and 2 deletions
|
@ -148,8 +148,8 @@ (define (check-final-period synopsis)
|
|||
'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)))
|
||||
|
|
|
@ -97,6 +97,24 @@ (define (call-with-warnings thunk)
|
|||
(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
|
||||
|
|
Loading…
Reference in a new issue