[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/10: lint: source: Stop as soon as a valid URL is found.
From: |
guix-commits |
Subject: |
09/10: lint: source: Stop as soon as a valid URL is found. |
Date: |
Fri, 19 Jul 2019 19:32:31 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 674b9df37da90ec6536e0ea7a5ab36785b732ae5
Author: Ludovic Courtès <address@hidden>
Date: Sat Jul 20 01:30:29 2019 +0200
lint: source: Stop as soon as a valid URL is found.
This restores the behavior of 'guix lint' prior to commit
50fc2384feb3bb2677d074f8f0deb5ae3c56b4d8.
* guix/lint.scm (check-source)[warnings-for-uris]: Rewrite to stop as
soon as one of URIS is valid.
---
guix/lint.scm | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/guix/lint.scm b/guix/lint.scm
index 1d097b1..7a2bf5a 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -740,11 +740,18 @@ descriptions maintained upstream."
"Emit a warning if PACKAGE has an invalid 'source' field, or if that
'source' is not reachable."
(define (warnings-for-uris uris)
- (filter-map (lambda (uri)
- (match (validate-uri uri package 'source)
- (#t #f)
- ((? lint-warning? warning) warning)))
- uris))
+ (let loop ((uris uris)
+ (warnings '()))
+ (match uris
+ (()
+ (reverse warnings))
+ ((uri rest ...)
+ (match (validate-uri uri package 'source)
+ (#t
+ ;; We found a working URL, so stop right away.
+ '())
+ ((? lint-warning? warning)
+ (loop rest (cons warning warnings))))))))
(let ((origin (package-source package)))
(if (and origin
- branch master updated (dd9560a -> 3d33c93), guix-commits, 2019/07/19
- 01/10: gnu: python-jupyter-client: Patch file name of 'ip'., guix-commits, 2019/07/19
- 03/10: ui: 'warn-about-load-error' provides hints for unbound variables., guix-commits, 2019/07/19
- 02/10: ui: 'warn-about-load-error' warns about file/module name mismatches., guix-commits, 2019/07/19
- 04/10: gnu: Add emacs-zerodark-theme., guix-commits, 2019/07/19
- 05/10: lint: Update tests to (guix lint) migration., guix-commits, 2019/07/19
- 06/10: lint: 'source' check no longer complains about unavailable mirrors., guix-commits, 2019/07/19
- 08/10: lint: Remove unused imports., guix-commits, 2019/07/19
- 07/10: lint: Add test for 'source'., guix-commits, 2019/07/19
- 10/10: lint: Use the 'warning' procedure for messages., guix-commits, 2019/07/19
- 09/10: lint: source: Stop as soon as a valid URL is found.,
guix-commits <=