guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: guix: lint: Warn only if GitHub URI is not same as the package UR


From: guix-commits
Subject: 01/01: guix: lint: Warn only if GitHub URI is not same as the package URI.
Date: Thu, 10 Jan 2019 05:11:22 -0500 (EST)

arunisaac pushed a commit to branch master
in repository guix.

commit 40fa21c22e1d11b741515fd38f5204a5fa57fbaa
Author: Arun Isaac <address@hidden>
Date:   Mon Jan 7 23:11:58 2019 +0530

    guix: lint: Warn only if GitHub URI is not same as the package URI.
    
    * guix/scripts/lint.scm (check-github-url): Warn only if the GitHub URI
    obtained after following redirects is not same as the original URI.
    * tests/lint.scm ("github-url: already the correct github url"): New test.
---
 guix/scripts/lint.scm | 11 ++++++-----
 tests/lint.scm        | 13 +++++++++++--
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 9acec48..0f315a9 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -8,7 +8,7 @@
 ;;; Copyright © 2017 Alex Kost <address@hidden>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <address@hidden>
 ;;; Copyright © 2017, 2018 Efraim Flashner <address@hidden>
-;;; Copyright © 2018 Arun Isaac <address@hidden>
+;;; Copyright © 2018, 2019 Arun Isaac <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -820,10 +820,11 @@ descriptions maintained upstream."
        (lambda (uri)
          (and=> (follow-redirects-to-github uri)
                 (lambda (github-uri)
-                  (emit-warning
-                   package
-                   (format #f (G_ "URL should be '~a'") github-uri)
-                   'source))))
+                  (unless (string=? github-uri uri)
+                    (emit-warning
+                     package
+                     (format #f (G_ "URL should be '~a'") github-uri)
+                     'source)))))
        (origin-uris origin)))))
 
 (define (check-derivation package)
diff --git a/tests/lint.scm b/tests/lint.scm
index fe12beb..912a78d 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2016 Hartmut Goebel <address@hidden>
 ;;; Copyright © 2017 Alex Kost <address@hidden>
 ;;; Copyright © 2017 Efraim Flashner <address@hidden>
-;;; Copyright © 2018 Arun Isaac <address@hidden>
+;;; Copyright © 2018, 2019 Arun Isaac <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -775,7 +775,16 @@
                                       (method url-fetch)
                                       (uri (%local-url))
                                       (sha256 %null-sha256))))))))))
-     github-url)))
+     github-url))
+  (test-assert "github-url: already the correct github url"
+    (string-null?
+     (with-warnings
+       (check-github-url
+        (dummy-package "x" (source
+                            (origin
+                              (method url-fetch)
+                              (uri github-url)
+                              (sha256 %null-sha256)))))))))
 
 (test-assert "cve"
   (mock ((guix scripts lint) package-vulnerabilities (const '()))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]