guix: lint: Make exception for package name starting description.
* guix/scripts/lint.scm (check-description-style): Exception for upper-case rule if the description starts with the package name. * tests/lint.scm: Test it.
This commit is contained in:
parent
903581f971
commit
3c42965b1e
|
@ -88,7 +88,8 @@
|
||||||
'description)))
|
'description)))
|
||||||
|
|
||||||
(define (check-proper-start description)
|
(define (check-proper-start description)
|
||||||
(unless (properly-starts-sentence? description)
|
(unless (or (properly-starts-sentence? description)
|
||||||
|
(string-prefix-ci? (package-name package) description))
|
||||||
(emit-warning package
|
(emit-warning package
|
||||||
"description should start with an upper-case letter or digit"
|
"description should start with an upper-case letter or digit"
|
||||||
'description)))
|
'description)))
|
||||||
|
|
|
@ -72,6 +72,15 @@
|
||||||
(check-description-style pkg))))
|
(check-description-style pkg))))
|
||||||
"description should start with an upper-case letter")))
|
"description should start with an upper-case letter")))
|
||||||
|
|
||||||
|
(test-assert "description: may start with lower-case package name"
|
||||||
|
(not
|
||||||
|
(string-contains (call-with-warnings
|
||||||
|
(lambda ()
|
||||||
|
(let ((pkg (dummy-package "x"
|
||||||
|
(description "x is a dummy package."))))
|
||||||
|
(check-description-style pkg))))
|
||||||
|
"description should start with an upper-case letter")))
|
||||||
|
|
||||||
(test-assert "description: two spaces after end of sentence"
|
(test-assert "description: two spaces after end of sentence"
|
||||||
(->bool
|
(->bool
|
||||||
(string-contains (call-with-warnings
|
(string-contains (call-with-warnings
|
||||||
|
|
Loading…
Reference in New Issue