guix: lint: Use if/when consistently.
* guix/scripts/lint.scm (check-synopsis-style): Replace single-branch uses of if with when. (check-patches): Same
This commit is contained in:
parent
86a4126348
commit
c04b82ffce
|
@ -104,21 +104,21 @@
|
|||
;; Emit a warning if stylistic issues are found in the synopsis of PACKAGE.
|
||||
(define (check-final-period synopsis)
|
||||
;; Synopsis should not end with a period, except for some special cases.
|
||||
(if (and (string-suffix? "." synopsis)
|
||||
(when (and (string-suffix? "." synopsis)
|
||||
(not (string-suffix? "etc." synopsis)))
|
||||
(emit-warning package
|
||||
"no period allowed at the end of the synopsis"
|
||||
'synopsis)))
|
||||
|
||||
(define (check-start-article synopsis)
|
||||
(if (or (string-prefix-ci? "A " synopsis)
|
||||
(when (or (string-prefix-ci? "A " synopsis)
|
||||
(string-prefix-ci? "An " synopsis))
|
||||
(emit-warning package
|
||||
"no article allowed at the beginning of the synopsis"
|
||||
'synopsis)))
|
||||
|
||||
(define (check-synopsis-length synopsis)
|
||||
(if (>= (string-length synopsis) 80)
|
||||
(when (>= (string-length synopsis) 80)
|
||||
(emit-warning package
|
||||
"synopsis should be less than 80 characters long"
|
||||
'synopsis)))
|
||||
|
@ -137,20 +137,20 @@
|
|||
'synopsis)))
|
||||
|
||||
(let ((synopsis (package-synopsis package)))
|
||||
(if (string? synopsis)
|
||||
(begin
|
||||
(check-synopsis-start-upper-case synopsis)
|
||||
(check-final-period synopsis)
|
||||
(check-start-article synopsis)
|
||||
(check-start-with-package-name synopsis)
|
||||
(check-synopsis-length synopsis)))))
|
||||
(when (string? synopsis)
|
||||
|
||||
(define (check-patches package)
|
||||
;; Emit a warning if the patches requires by PACKAGE are badly named.
|
||||
(let ((patches (and=> (package-source package) origin-patches))
|
||||
(name (package-name package))
|
||||
(full-name (package-full-name package)))
|
||||
(if (and patches
|
||||
(when (and patches
|
||||
(any (match-lambda
|
||||
((? string? patch)
|
||||
(let ((filename (basename patch)))
|
||||
|
|
Loading…
Reference in New Issue